Skip to main content

To automate the Django Admin displaying.

Project description


from daa.admin import AutoModelAdmin

from django.db.models import Q

from django.utils.html import format_html

class OwnershipModelAdmin(AutoModelAdmin):

def get_queryset_Q(self, request):
return Q(owner=request.user)
def get_form_field_queryset_Q(self, db_field, request):
return Q(onwer=request.user)
def get_form_fields_exclude(self,request,obj=None):
return () if obj else (‘owner’,)
def action(self,obj):
return format_html(‘<a href=”url” class=”button”>Load</a>’)



pip install django-admin-auto

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-admin-auto, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django-admin-auto-0.1.1.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page