Post Admin filter by tags and search by title

This commit is contained in:
Patrick Hetu 2016-07-14 14:36:45 -04:00 committed by Iacopo Spalletti
parent 6bf6bdc159
commit cd92451e78
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6

View file

@ -55,7 +55,16 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
'title', 'author', 'date_published', 'app_config', 'all_languages_column', 'title', 'author', 'date_published', 'app_config', 'all_languages_column',
'date_published_end' 'date_published_end'
] ]
list_filter = ('app_config',) try:
from taggit_helpers.admin import TaggitListFilter
list_filter = ('app_config', TaggitListFilter)
except ImportError:
try:
from taggit_helpers import TaggitListFilter
list_filter = ('app_config', TaggitListFilter)
except ImportError:
list_filter = ('app_config',)
search_fields = ('translations__title',)
date_hierarchy = 'date_published' date_hierarchy = 'date_published'
raw_id_fields = ['author'] raw_id_fields = ['author']
frontend_editable_fields = ('title', 'abstract', 'post_text') frontend_editable_fields = ('title', 'abstract', 'post_text')