I have these models:
def Foo(Models.model): size = models.IntegerField() # other fields def is_active(self): if check_condition:
You could also use a custom manager. Then you could run something like this:
Bar.objects.foo_active()
And all you have to do is:
class BarManager(models.Manager): def foo_active(self): # use your method to filter results return you_custom_queryset
Check out the docs.