Allow easy adding/removing of multiple photos directly in the admin panel.
This commit is contained in:
parent
ff3cfb9a66
commit
eebe253d0b
1 changed files with 2 additions and 4 deletions
|
|
@ -14,11 +14,9 @@ class GalleryAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = "date_start"
|
date_hierarchy = "date_start"
|
||||||
prepopulated_fields = {"slug": ("title",)}
|
prepopulated_fields = {"slug": ("title",)}
|
||||||
model = Gallery
|
model = Gallery
|
||||||
exclude = ["photos"]
|
|
||||||
autocomplete_fields = ["tags"]
|
autocomplete_fields = ["tags"]
|
||||||
search_fields = [
|
search_fields = ["title",]
|
||||||
"title",
|
filter_horizontal = ("photos",)
|
||||||
]
|
|
||||||
|
|
||||||
def get_tags(self, obj):
|
def get_tags(self, obj):
|
||||||
return ", ".join([t.name for t in obj.tags.all()])
|
return ", ".join([t.name for t in obj.tags.all()])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue