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
1 changed files with 10 additions and 1 deletions

View File

@ -55,7 +55,16 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
'title', 'author', 'date_published', 'app_config', 'all_languages_column',
'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'
raw_id_fields = ['author']
frontend_editable_fields = ('title', 'abstract', 'post_text')