admin.ModelAdmin.has_add_permission()

ModelAdmin.has_add_permission(request) Should return True if adding an object is permitted, False otherwise.

admin.ModelAdmin.get_urls()

ModelAdmin.get_urls() [source] The get_urls method on a ModelAdmin returns the URLs to be used for that ModelAdmin in the same way as a URLconf. Therefore you can extend them as documented in URL dispatcher: class MyModelAdmin(admin.ModelAdmin): def get_urls(self): urls = super(MyModelAdmin, self).get_urls() my_urls = [ url(r'^my_view/$', self.my_view), ] return my_urls + urls def my_view(self, request): # ... context = dic

admin.ModelAdmin.get_search_results()

ModelAdmin.get_search_results(request, queryset, search_term) [source] The get_search_results method modifies the list of objects displayed into those that match the provided search term. It accepts the request, a queryset that applies the current filters, and the user-provided search term. It returns a tuple containing a queryset modified to implement the search, and a boolean indicating if the results may contain duplicates. The default implementation searches the fields named in ModelAdmi

admin.ModelAdmin.get_search_fields()

ModelAdmin.get_search_fields(request) [source] The get_search_fields method is given the HttpRequest and is expected to return the same kind of sequence type as for the search_fields attribute.

admin.ModelAdmin.get_readonly_fields()

ModelAdmin.get_readonly_fields(request, obj=None) The get_readonly_fields method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a list or tuple of field names that will be displayed as read-only, as described above in the ModelAdmin.readonly_fields section.

admin.ModelAdmin.get_queryset()

ModelAdmin.get_queryset(request) The get_queryset method on a ModelAdmin returns a QuerySet of all model instances that can be edited by the admin site. One use case for overriding this method is to show objects owned by the logged-in user: class MyModelAdmin(admin.ModelAdmin): def get_queryset(self, request): qs = super(MyModelAdmin, self).get_queryset(request) if request.user.is_superuser: return qs return qs.filter(author=request.user)

admin.ModelAdmin.get_prepopulated_fields()

ModelAdmin.get_prepopulated_fields(request, obj=None) The get_prepopulated_fields method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a dictionary, as described above in the ModelAdmin.prepopulated_fields section.

admin.ModelAdmin.get_paginator()

ModelAdmin.get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True) [source] Returns an instance of the paginator to use for this view. By default, instantiates an instance of paginator.

admin.ModelAdmin.get_ordering()

ModelAdmin.get_ordering(request) The get_ordering method takes a request as parameter and is expected to return a list or tuple for ordering similar to the ordering attribute. For example: class PersonAdmin(admin.ModelAdmin): def get_ordering(self, request): if request.user.is_superuser: return ['name', 'rank'] else: return ['name']

admin.ModelAdmin.get_list_select_related()

ModelAdmin.get_list_select_related(request) [source] New in Django 1.9. The get_list_select_related method is given the HttpRequest and should return a boolean or list as ModelAdmin.list_select_related does.