I have these models:
def Foo(Models.model): size = models.IntegerField() # other fields def is_active(self): if check_condition: return True else: return False def Bar(Models.model): foo = models.ForeignKey("Foo") # other fields
Now I want to request bars that have active Foo as such:
Bar.objects.filter(foo.is_active())
I get an error like
SyntaxError at / ('non-keyword arg after keyword arg'
How can i achieve this?
python django django-models django-orm django-queryset
Hellnar Feb 16 2018-10-16 10:14
source share