Skip to main content

Example

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):
if db_field.name==’account’:

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>’)

extra=(‘action’,)

Install

pip install django-admin-auto

Release files for django-admin-auto 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-auto 0.1.1
File Size Uploaded
django-admin-auto-0.1.1.tar.gz 2.3 kB Details

Release files / django-admin-auto-0.1.1.tar.gz

Download URL django-admin-auto-0.1.1.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f88a41f65dad537c8afe7e97ce6dd8ed45a932ae9031ed172c9352bb26ecb061
BLAKE2b-256 checksum
How to use checksums
86b1b524afd2d347541da8265f64def7478dedcc959c5a7963cf828e35156ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page