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.
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.