﻿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
12145	select_related() does not work with inherited models	Pavel Lang	nobody	"Example code:
{{{
from django.db import models

class BaseModel(models.Model):
    base_text = models.TextField()

class InheritedA(BaseModel):
    textA = models.TextField()

class InheritedB(BaseModel):
    textB = models.TextField()
}}}

Now, when I select {{{ BaseModel.objects.all() }}} there is no (possible/easy) way to prefetch related models InheritedA and InheritedB with left outer join and reduce further queries to get each inherited instance of models.

When model inheritance is alowed and modeled as OneToOne relation, it should be possible to do optimization in same sense as select_related() do with foreign keys."		closed	Database layer (models, ORM)	dev		duplicate	select_related		Unreviewed	0	0	0	0	0	0
