Add filter to admin add page?

44 views
Skip to first unread message

Wil Moskal

unread,
Oct 21, 2019, 6:07:40 PM10/21/19
to Django users
I have a model registered to the admin page, AuthUserFilePermissions, which consists of 2 foreign keys, a key to the defined groups, and a key to the filepatterns. Within the add AuthUserFilePermissions, there is a select for each. For the group this is fine, as there is only like 7-8. for the file patterns this is not good, as there are over 1000 file patterns. What I am trying to do is implement a search filter for the file pattern entry, similar to how in the add group page there is a filter for the permissions, around the select. Any Idea how I could complete this?

On a side note, the fields that I am entering within my modelAdmins are not appearing on the add page, so it would also be good to know why not. 

Derek

unread,
Oct 23, 2019, 5:00:10 AM10/23/19
to Django users
For your filter problem, you probably need to use: https://github.com/farhan0581/django-admin-autocomplete-filter

Nelson Varela

unread,
Oct 23, 2019, 10:13:13 AM10/23/19
to Django users
Or even better... whu not use django's own auto complete feature in the admin: https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields

Op dinsdag 22 oktober 2019 00:07:40 UTC+2 schreef Wil Moskal:

Derek

unread,
Oct 30, 2019, 2:30:54 AM10/30/19
to Django users
It is not clear if those fields can be used in the admin list interface drop-down filters - is there a link to documentation for that?
Reply all
Reply to author
Forward
0 new messages