﻿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
7252	Non-default managers inherited from an abstract model don't function.	floguy	nobody	"Given these models:

{{{
class NaiveHierarchyManager(models.Manager):
    def get_roots(self):
        return self.get_query_set().filter(parent__isnull=True)

class NaiveHierarchy(models.Model):
    parent = models.ForeignKey('self', null=True)
    
    tree = NaiveHierarchyManager()
    
    class Meta:
        abstract = True

class BlogPost(NaiveHierarchy):
    title = models.CharField(max_length = 128)
    body = models.TextField()
    
    objects = models.Manager()
    
    def __unicode__(self):
        return self.title
}}}

What happens is that the 'tree' manager gets assigned correctly to !BlogPost, but the manager's 'model' attribute still points to !NaiveHierarchy, which is not the correct model.  Upon trying to use the manager through !BlogPost, it gives an !AttributeError, complaining that the attribute {{{_join_cache}}} doesn't exist on !NaiveHierarchy (which it shouldn't).

I've attached a patch which fixes the problem in all cases, and I can't think of a reason why it wouldn't work, but it seems like the problem is better solved elsewhere.  However, all attempts on my part to fix the problem elsewhere I ran into snags.  (!Manager's .model isn't set by the time {{{ModelBase.__new__}}} gets called, etc)."		closed	Uncategorized	dev		duplicate			Unreviewed	1	0	0	0	0	0
