class documentation

Functionality common to both ModelAdmin and InlineAdmin.

Method __init__ Undocumented
Method check Undocumented
Method formfield_for_choice_field Get a form Field for a database Field that has declared choices.
Method formfield_for_dbfield Hook for specifying the form Field instance for a given database Field instance.
Method formfield_for_foreignkey Get a form Field for a ForeignKey.
Method formfield_for_manytomany Get a form Field for a ManyToManyField.
Method get_autocomplete_fields Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
Method get_empty_value_display Return the empty_value_display set on ModelAdmin or AdminSite.
Method get_exclude Hook for specifying exclude.
Method get_field_queryset If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don't specify the queryset, let the field decide (return None in that case).
Method get_fields Hook for specifying fields.
Method get_fieldsets Hook for specifying fieldsets.
Method get_inlines Hook for specifying custom inlines.
Method get_ordering Hook for specifying field ordering.
Method get_prepopulated_fields Hook for specifying custom prepopulated fields.
Method get_queryset Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
Method get_readonly_fields Hook for specifying custom readonly fields.
Method get_sortable_by Hook for specifying which fields can be sorted in the changelist.
Method get_view_on_site_url Undocumented
Method has_add_permission Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.
Method has_change_permission Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter.
Method has_delete_permission Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter.
Method has_module_permission Return True if the given request has any permission in the given app label.
Method has_view_or_change_permission Undocumented
Method has_view_permission Return True if the given request has permission to view the given Django model instance. The default implementation doesn't examine the `obj` parameter.
Method lookup_allowed Undocumented
Method to_field_allowed Return True if the model associated with this admin should be allowed to be referenced by the specified field.
Class Variable autocomplete_fields Undocumented
Class Variable exclude Undocumented
Class Variable fields Undocumented
Class Variable fieldsets Undocumented
Class Variable filter_horizontal Undocumented
Class Variable filter_vertical Undocumented
Class Variable ordering Undocumented
Class Variable prepopulated_fields Undocumented
Class Variable radio_fields Undocumented
Class Variable raw_id_fields Undocumented
Class Variable readonly_fields Undocumented
Class Variable show_full_result_count Undocumented
Class Variable sortable_by Undocumented
Class Variable view_on_site Undocumented
Instance Variable formfield_overrides Undocumented
def check(self, **kwargs): (source)

Undocumented

def formfield_for_choice_field(self, db_field, request, **kwargs): (source)

Get a form Field for a database Field that has declared choices.

def formfield_for_dbfield(self, db_field, request, **kwargs): (source)

Hook for specifying the form Field instance for a given database Field instance. If kwargs are given, they're passed to the form Field's constructor.

def formfield_for_foreignkey(self, db_field, request, **kwargs): (source)

Get a form Field for a ForeignKey.

def formfield_for_manytomany(self, db_field, request, **kwargs): (source)

Get a form Field for a ManyToManyField.

def get_autocomplete_fields(self, request): (source)

Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.

def get_empty_value_display(self): (source)

Return the empty_value_display set on ModelAdmin or AdminSite.

def get_exclude(self, request, obj=None): (source)

Hook for specifying exclude.

def get_field_queryset(self, db, db_field, request): (source)

If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don't specify the queryset, let the field decide (return None in that case).

def get_fields(self, request, obj=None): (source)

Hook for specifying fields.

def get_fieldsets(self, request, obj=None): (source)

Hook for specifying fieldsets.

def get_inlines(self, request, obj): (source)

Hook for specifying custom inlines.

def get_ordering(self, request): (source)

Hook for specifying field ordering.

def get_prepopulated_fields(self, request, obj=None): (source)

Hook for specifying custom prepopulated fields.

def get_queryset(self, request): (source)

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

def get_readonly_fields(self, request, obj=None): (source)

Hook for specifying custom readonly fields.

def get_sortable_by(self, request): (source)

Hook for specifying which fields can be sorted in the changelist.

def get_view_on_site_url(self, obj=None): (source)

Undocumented

def has_add_permission(self, request): (source)

Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.

def has_change_permission(self, request, obj=None): (source)

Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the `obj` model instance. If `obj` is None, this should return True if the given request has permission to change *any* object of the given type.

def has_delete_permission(self, request, obj=None): (source)

Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the `obj` model instance. If `obj` is None, this should return True if the given request has permission to delete *any* object of the given type.

def has_module_permission(self, request): (source)

Return True if the given request has any permission in the given app label. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module's index page. Overriding it does not restrict access to the add, change or delete views. Use `ModelAdmin.has_(add|change|delete)_permission` for that.

def has_view_or_change_permission(self, request, obj=None): (source)

Undocumented

def has_view_permission(self, request, obj=None): (source)

Return True if the given request has permission to view the given Django model instance. The default implementation doesn't examine the `obj` parameter. If overridden by the user in subclasses, it should return True if the given request has permission to view the `obj` model instance. If `obj` is None, it should return True if the request has permission to view any object of the given type.

def lookup_allowed(self, lookup, value): (source)

Undocumented

def to_field_allowed(self, request, to_field): (source)

Return True if the model associated with this admin should be allowed to be referenced by the specified field.

autocomplete_fields: tuple = (source)

Undocumented

Undocumented

Undocumented

filter_vertical: tuple = (source)

Undocumented

prepopulated_fields: dict = (source)

Undocumented

raw_id_fields: tuple = (source)

Undocumented

readonly_fields: tuple = (source)

Undocumented

show_full_result_count: bool = (source)

Undocumented

sortable_by = (source)

Undocumented

view_on_site: bool = (source)

Undocumented

formfield_overrides = (source)

Undocumented