annotated with M2M field (sum values from related model) #913
Unanswered
diegocgaona
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have 2 models:
I want to filter some clients (by some fields, like industry) and sum the value of their related jobs:
I thought about something like this:
But I receive:
tortoise.exceptions.ConfigurationError: jobs__value not resolvable
It is possible to do that in a way like this?
I will try to get the client ids (filtered) and make another filter and annotate on the Jobs model, but I think maybe there's a better approach like the above. I tried some ways in the documentation, but I couldn't adapt or understand for my case.
Regards, Diego.
Beta Was this translation helpful? Give feedback.
All reactions