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:
fieldsets = (("Title"|None, options), ) options = { fields : (('one', 'line', 'together'), 'field5', 'field6'), classes : ['collapse', 'wide'] }
or use the following:
fields = ('field1', 'field2') exclude = ('field3', 'field4')
And some other edit screen options:
filter_horizontal|filter_vertical = ('multi_select_field')
radio_fields = ('fk_field', 'choice_field')
save_on_top = True
For further details, see the Admin App documentation. Also useful are the Custom Actions documentation, the DB Queries documentation, and the QuerySet documentation.
]]>db_table = "string"
managed = False
(whether SQL is generated by the manage.py app)ordering = ['column1', '-column2']
(NB admin app only uses the first)order_with_respect_to = 'fk_field'
unique_together = (('column1', 'column2'), )
verbose_name = "String"
verbose_name_plural = "String"
abstract = True
null = True
blank = True
choices = (('db_val', 'displayed_val'), )
db_column = "string"
db_index = True
default = "string"
editable = False
primary_key = True
unique = True
verbose_name = "String"
AutoField
BooleanField
CharField (max_length=integer)
DateField|DateTimeField(auto_now_add=True)
IPAddressField
PositiveIntegerField
TextField
ForeignKey(Class, to_field='related_field')
ManyToManyField(Class, to_field='related_field')
For further details, see the Models documentation, Meta Options documentation and Field Types documentation.
]]>