I use django-photologue and extended it:
# gallery.models.py
from photologue.models import Photo
from profiles.models import UserProfile
class PhotoExtended(Photo):
user = models.ForeignKey(UserProfile, verbose_name=_('user'), on_delete=models.CASCADE)
# gallery.admin.py
from photologue.admin import PhotoAdmin as PhotoAdminDefault
from photologue.models import Photo
from .models import PhotoExtended
class PhotoAdmin(PhotoAdminDefault):
save_on_top = True
admin.site.unregister(Photo)
admin.site.register(PhotoExtended, PhotoAdmin)
Photologue has a feature to upload zip file with photos and it can be done using additional button in admin. After my changes this button disappeared.
Is it possible to use native photologues admin templates in order to avoid copy-pasting them to my app's template folder? In INSTALLED_APPS photologue is higher than my gallery app
Here there are the photologues admin templates.
In the path
templates/admin/photologue/photo/change_list.htmlthe partphotocorresponds to thePhotomodel. You subclassed that model. The new model name isPhotoExtendedbut there is no template intemplates/admin/photologue/photo_extend/change_list.html.Copy the
change_list.htmlfrom photologue app into your own (app) template folder. Eg:project/app/templates/admin/photologue/photo_extend/change_list.html.Alternatively you can also just create a new file and use include the old template:
Update: Another alternative is to set (one of) the BaseModelAdmin properties: