Commit 4fde5665 authored by Thom Wiggers's avatar Thom Wiggers 📐

Merge branch 'feature/photos-filter-search' into 'master'

Add filtering and searching to photos admin

Closes #219

See merge request !380
parents e0846021 0326a7ac
......@@ -67,6 +67,10 @@ def save_photo(request, archive_file, photo, album):
class AlbumAdmin(admin.ModelAdmin):
list_display = ('title', 'date', 'hidden', 'shareable')
search_fields = ('title', 'date')
list_filter = ('hidden', 'shareable')
date_hierarchy = 'date'
prepopulated_fields = {'slug': ('date', 'title',)}
form = AlbumForm
......@@ -100,6 +104,10 @@ class AlbumAdmin(admin.ModelAdmin):
class PhotoAdmin(admin.ModelAdmin):
list_display = ('file', 'album', 'hidden')
search_fields = ('file',)
list_filter = ('album', 'hidden')
def save_model(self, request, obj, form, change):
obj.save()
messages.add_message(request, messages.WARNING,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment