﻿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
36188	Reverse lookups on OneToOneField not working?	Willem Van Onsem	hesham hatem	"This [https://stackoverflow.com/q/79437187/67579 StackOverflow post] shows a scenario where a `OneToOneField` is filtered on top of another `OneToOneField`. So for example with the following modeling:

{{{
class Switch(models.Model):
    fqdn = models.CharField(max_length=45, unique=True)

class ConfigState(models.Model):
    switch = models.OneToOneField(Switch, models.CASCADE, db_column='switch', primary_key=True,
                                  related_name='config_state')

class EdgeSwitch(models.Model):
    switch = models.OneToOneField(Switch, models.CASCADE, db_column='switch', primary_key=True,
                                      related_name='edge_switch')
}}}

The query `EdgeSwitch.objects.filter(switch__config_state=1)` does (no longer) work. On Django-3.x it apparently worked."	Bug	closed	Database layer (models, ORM)	5.1	Normal	invalid			Unreviewed	0	0	0	0	0	0
