You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
When listing your notes, the admin just shows Note object for each note. That's not too helpful. This view can be customize in many interesting ways. (Full documentation at: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/). We'll play with a few of these now.
Define a custom admin class in note/admin.py:
class NoteAdmin(admin.ModelAdmin):
list_display = ('title', 'pub_date', 'was_published_recently')
list_filter = ['pub_date']
# Replace your other register call with this line:
admin.site.register(Note, NoteAdmin)
Also, we referred to a new method. Add this method in your Note model in note/models.py:
Now the admin list will appear much more useful. We didn't customize the page to create/edit notes, but options are available for that as well (see docs above).