class documentation

class ModelAdminChecks(BaseModelAdminChecks):

View In Hierarchy

Undocumented

Method ​_check​_action​_permission​_methods Actions with an allowed_permission attribute require the ModelAdmin to implement a has_<perm>_permission() method for each permission.
Method ​_check​_actions​_uniqueness Check that every action has a unique __name__.
Method ​_check​_date​_hierarchy Check that date_hierarchy refers to DateField or DateTimeField.
Method ​_check​_inlines Check all inline model admin classes.
Method ​_check​_inlines​_item Check one inline model admin.
Method ​_check​_list​_display Check that list_display only contains fields or usable attributes.
Method ​_check​_list​_display​_item Undocumented
Method ​_check​_list​_display​_links Check that list_display_links is a unique subset of list_display.
Method ​_check​_list​_display​_links​_item Undocumented
Method ​_check​_list​_editable Check that list_editable is a sequence of editable fields from list_display without first element.
Method ​_check​_list​_editable​_item Undocumented
Method ​_check​_list​_filter Undocumented
Method ​_check​_list​_filter​_item No summary
Method ​_check​_list​_max​_show​_all Check that list_max_show_all is an integer.
Method ​_check​_list​_per​_page Check that list_per_page is an integer.
Method ​_check​_list​_select​_related Check that list_select_related is a boolean, a list or a tuple.
Method ​_check​_save​_as Check save_as is a boolean.
Method ​_check​_save​_on​_top Check save_on_top is a boolean.
Method ​_check​_search​_fields Check search_fields is a sequence.
Method check Undocumented

Inherited from BaseModelAdminChecks:

Method ​_check​_autocomplete​_fields Check that autocomplete_fields is a list or tuple of model fields.
Method ​_check​_autocomplete​_fields​_item Check that an item in autocomplete_fields is a ForeignKey or a ManyToManyField and that the item has a related ModelAdmin with search_fields defined.
Method ​_check​_exclude Check that exclude is a sequence without duplicates.
Method ​_check​_field​_spec fields should be an item of fields or an item of fieldset[1]['fields'] for any fieldset in fieldsets. It should be a field name or a tuple of field names.
Method ​_check​_field​_spec​_item Undocumented
Method ​_check​_fields Check that fields only refer to existing fields, doesn't contain duplicates. Check if at most one of fields and fieldsets is defined.
Method ​_check​_fieldsets Check that fieldsets is properly formatted and doesn't contain duplicates.
Method ​_check​_fieldsets​_item Check an item of fieldsets, i.e. check that this is a pair of a set name and a dictionary containing "fields" key.
Method ​_check​_filter​_horizontal Check that filter_horizontal is a sequence of field names.
Method ​_check​_filter​_item Check one item of filter_vertical or filter_horizontal, i.e. check that given field exists and is a ManyToManyField.
Method ​_check​_filter​_vertical Check that filter_vertical is a sequence of field names.
Method ​_check​_form Check that form subclasses BaseModelForm.
Method ​_check​_ordering Check that ordering refers to existing fields or is random.
Method ​_check​_ordering​_item Check that ordering refers to existing fields.
Method ​_check​_prepopulated​_fields Check that prepopulated_fields is a dictionary containing allowed field types.
Method ​_check​_prepopulated​_fields​_key Check a key of prepopulated_fields dictionary, i.e. check that it is a name of existing field and the field is one of the allowed types.
Method ​_check​_prepopulated​_fields​_value Check a value of prepopulated_fields dictionary, i.e. it's an iterable of existing fields.
Method ​_check​_prepopulated​_fields​_value​_item For prepopulated_fields equal to {"slug": ("title",)}, field_name is "title".
Method ​_check​_radio​_fields Check that radio_fields is a dictionary.
Method ​_check​_radio​_fields​_key Check that a key of radio_fields dictionary is name of existing field and that the field is a ForeignKey or has choices defined.
Method ​_check​_radio​_fields​_value Check type of a value of radio_fields dictionary.
Method ​_check​_raw​_id​_fields Check that raw_id_fields only contains field names that are listed on the model.
Method ​_check​_raw​_id​_fields​_item Check an item of raw_id_fields, i.e. check that field named field_name exists in model model and is a ForeignKey or a ManyToManyField.
Method ​_check​_readonly​_fields Check that readonly_fields refers to proper attribute or field.
Method ​_check​_readonly​_fields​_item Undocumented
Method ​_check​_view​_on​_site​_url Undocumented
def _check_action_permission_methods(self, obj):
Actions with an allowed_permission attribute require the ModelAdmin to implement a has_<perm>_permission() method for each permission.
def _check_actions_uniqueness(self, obj):
Check that every action has a unique __name__.
def _check_date_hierarchy(self, obj):
Check that date_hierarchy refers to DateField or DateTimeField.
def _check_inlines(self, obj):
Check all inline model admin classes.
def _check_inlines_item(self, obj, inline, label):
Check one inline model admin.
def _check_list_display(self, obj):
Check that list_display only contains fields or usable attributes.
def _check_list_display_item(self, obj, item, label):

Undocumented

def _check_list_display_links(self, obj):
Check that list_display_links is a unique subset of list_display.
def _check_list_display_links_item(self, obj, field_name, label):

Undocumented

def _check_list_editable(self, obj):
Check that list_editable is a sequence of editable fields from list_display without first element.
def _check_list_editable_item(self, obj, field_name, label):

Undocumented

def _check_list_filter(self, obj):

Undocumented

def _check_list_filter_item(self, obj, item, label):

Check one item of list_filter, i.e. check if it is one of three options: 1. 'field' -- a basic field filter, possibly w/ relationships (e.g.

'field__rel')
  1. ('field', SomeFieldListFilter) - a field-based list filter class
  2. SomeListFilter - a non-field list filter class
def _check_list_max_show_all(self, obj):
Check that list_max_show_all is an integer.
def _check_list_per_page(self, obj):
Check that list_per_page is an integer.
def _check_list_select_related(self, obj):
Check that list_select_related is a boolean, a list or a tuple.
def _check_save_as(self, obj):
Check save_as is a boolean.
def _check_save_on_top(self, obj):
Check save_on_top is a boolean.
def _check_search_fields(self, obj):
Check search_fields is a sequence.
def check(self, admin_obj, **kwargs):