Django Admin App Views

Following my previous post about configuring Django models, I’m now ready to work on the view. Remember, this is simply within the “Admin” app which ships with Django, and below is a non-exhaustive set of options:

ModelAdmin Derived Class Options

For the list screen:

list_display = ('field1', 'field2')

list_display_links = ['field2']

list_editable = ['field2']

list_filter = ('field1', 'field2')

list_per_page = 20

search_fields = ['field1', 'foreign_key__fieldname']

For the edit screen, it’s possible to control the form layout and displayed fields: