django's manager docs has a paragraph overwritten with DO NOT FILTER AWAY ANY RESULTS IN THIS TYPE OF MANAGER SUBCLASS
, but in the following text only mentions get_query_set()
Is it save to filter in all(), get(), filter(), exclude()?
The reason why I want to do that: I want for the automatic Manager as it gives my the power to control, what rows are send to a template-tag as described in b-list: Write better template tags
Would this code be OK?
class ArticleMananger(models.Manager):
def get_query_set(self):
return super(ArticleMananger, self).get_query_set()
def all(self):
return super(ArticleMananger, self).filter(published=True)
def filter(self, **kwargs):
return super(ArticleMananger, self).filter(published=True).filter(**kwargs)
....
Edit: If someone votes down, it would be nice or just fair to explain why. What is wrong about this question?