I am trying a simple custom manager, but I can't concatenate custom queries:
class MyManager(models.Manager):
def some_filter(self):
qs = self.get_query_set()
return qs.filter(score__gt = 10).order_by("-score")
class Game(models.Model):
score = models.IntegerField(blank=True, default=0)
objects = MyManager()
games = Game.objects.filter(any_filter).some_filter()[:5]
But I get QuerySet' object has no attribute 'some_filter'
Edit: It appears that the question is how to concatenate custom filter functions together: seomthing like games = Game.objects.some_filter1().some_filter2()[:5]
just won't work for me.