﻿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
18012	Propagate reverse foreign keys from proxy models to base class	Anssi Kääriäinen	Simon Charette	"The idea of proxy model is that the proxy subclass changes behavior, but the base class and all proxy models derived from it (call this ""proxy equivalence class"") are identical in the database representation. Foreign keys defined to proxy models break this idea:
{{{
class A(models.Model):
    pass
class ProxyA(A):
    class Meta:
       proxy = True
class B(models.Model):
    a = models.ForeignKey(ProxyA)
}}}

The above code is allowed currently, but A does not have a reverse relation to B, while ProxyA has that. It would be nice from maintainability perspective to have exactly same field set for every model in the proxy equivalence class. In addition, adding the reverse relation to the equivalence class would make the database representation equivalent to the Python representation."	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed		Simon Charette james@…	Ready for checkin	1	0	0	0	0	0
