4👍
You can add date_hierarchy = 'created_at'
to your admin class.
class TaggedArticle(admin.ModelAdmin):
date_hierarchy = 'created_at'
fields = ['category_fit', 'article', 'link', 'relevant_feedback', 'category', 'user', 'email', 'created_at']
list_display = ['article_id', 'link', 'user', 'created_at']
list_filter = ['user', 'email']
model = Tagged
It also provides the ability to filter by month, day in a better way than implementing it by ourselves.
1👍
Use django-daterange-filter package for filter on year.
And refer django-list-filter documentation.
May this helps you
- [Django]-Facebook Signed Request Decoding Incorrect Padding
- [Django]-Which template shows the words "Site administration" under the colored horizontal banner in Django's admin page?
- [Django]-Django : Get user IP from development server
- [Django]-'User' object has no attribute 'username'
- [Django]-Why is my JSON from Django being cut-off at about 2.1MB?
Source:stackexchange.com