﻿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
21297	CurrentSiteManager returns objects of superclass for sub-models that do not define any additional fields	dp@…	nobody	"Suppose I have two models, one inheriting the other:


{{{
class BaseModel(models.Model):
    title = models.CharField()
    # ...

    objects = models.Manager()
    on_site = CurrentSiteManager()
}}}


Then I create a subclass:


{{{
class SubModel(BaseModel):
    objects = models.Manager()
    on_site = CurrentSiteManager()

    # ...
}}}


Then calling SubModel.on_site.all() returns a QuerySet containing all instances of BaseModel on that site. Checking the SQL reveals that that no table join to the sub_model table occurs.

This can be worked around by instead calling {{{SubModel.objects.filter(site=settings.SITE_ID)}}}, but I do believe this to be a bug."	Uncategorized	closed	contrib.sites	1.5	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
