Consider below example:
class ModelX(models.Model):
fieldX = models.ForeignKey(ModelY)
class ModelY(MPTTModel):
def root(self):
return get_root()
root = property(root)
Now I would like to make query like this
ModelX.objects.filter(fieldX__root=match)
or better yet directly calling get_root()
like this
ModelX.objects.filter(fieldX__get_root=match)
which would make the root()
method superfluous.
None of the above seem to work though. Why is that?