How do I inherit a ModelManager?
class Content(models.Model):
name = models.CharField(max_length=255, verbose_name='Name des Blogs')
slug = models.SlugField(max_length=80, blank=True)
objects = models.Manager()
active = ContentActiveManager()
class ContentActiveManager(models.Manager):
def get_query_set(self):
return super(ContentActiveManager,self).get_query_set().filter(activated=True,show=True)
class BlogCatalog(Content):
frequency = models.PositiveSmallIntegerField(max_length=2, choices=make_index_based_tuple(l=FREQUENCY), verbose_name='Frequenz',)
blog = BlogCatalog.active.get(pk=1)
blog
is now obviously a Content object.
If I type Catalog.active.get(pk=1) I want a Content object but
If I type BlogCatalog.active.get(pk=1) I want a BlogCatalog object.
How do I achieve this without being redundant?