﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27356	admin lookup_allowed incorrectly returns False for a nested reverse OneToOneField	Tobias Krönke	Tim Graham <timograham@…>	"Assume these 3 models in an app called `foo`:

{{{#!python
class Somebody(models.Model):
    user = models.OneToOneField(AUTH_USER_MODEL)

class Profile(models.Model):  # we want an admin for this and filter on related data!
    who = models.OneToOneField(Somebody)

class ClientInfo(models.Model):
    who = models.OneToOneField(Somebody)
    filter_by_me_please = models.CharField(db_index=True, max_length=20, blank=True)
}}}

and this profile admin:

{{{#!python
class ProfileAdmin(admin.ModelAdmin):
    list_filter = ('who__clientinfo__filter_by_me_please', )

admin.site.register(Profile, ProfileAdmin)
}}}

I get this error
{{{
DisallowedModelAdminLookup at /admin/foo/profile/
Filtering by who__clientinfo__filter_by_me_please not allowed
}}}
on opening http://localhost:8000/admin/foo/profile/?who__clientinfo__filter_by_me_please=yay

The 3 lookup levels seem to be important to reproduce this."	Bug	closed	contrib.admin	dev	Normal	fixed		desecho@…	Accepted	1	0	0	0	0	0
