Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Django DisallowedModelAdminLookup for lookup in Admin list_filter

I have a Member model and an Organization model, joined via a PrincipleMembership model. PrincipleMembership has ForeignKey fields for Member and Organization.

I create MemberAdmin with the line list_filter = ['principlemembership__organization__type', ], the filter renders perfectly, but clicking on it produces the DisallowedModelAdminLookup exception.

I can fix it by overriding ModelAdmin.Lookup_allowed to permit principlemembership__organization__type__exact, but is this a bug in Django? I'm on Python 3.5.3 and Django 1.10.

I have tried adding filters on organization.type to OrganizationAdmin and PrincipleMembershipAdmin, both of which work. I do not use a many to many join as I have other data on PrincipleMembership, such as From and To dates. I have tried making the filter explicitly a admin.ChoicesFieldListFilter. I have tried removing everything else from MemberAdmin except list_filter = ['principlemembership__organization__type', ]. I have tried a filter on a simple Char field on Organization and get the same error.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Looks like it was a bug, fixed in 1.11.3. See the change in this commit: https://github.com/django/django/commit/834d57b4de80e525195128c88592e0e076708a23

The 1.11.3 release notes have a link to the ticket.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!