Allow easy adding/removing of multiple photos directly in the admin panel.

This commit is contained in:
krek0 2026-04-22 21:29:02 +02:00
parent ff3cfb9a66
commit eebe253d0b

View file

@ -14,11 +14,9 @@ class GalleryAdmin(admin.ModelAdmin):
date_hierarchy = "date_start"
prepopulated_fields = {"slug": ("title",)}
model = Gallery
exclude = ["photos"]
autocomplete_fields = ["tags"]
search_fields = [
"title",
]
search_fields = ["title",]
filter_horizontal = ("photos",)
def get_tags(self, obj):
return ", ".join([t.name for t in obj.tags.all()])