python - Smart Querying in Django, ManyToMany relationships with User -


I am working on the app that currently has so many links (and eventually more will be), And I'm trying to think of the clever methods (read correctly) to properly ask ORM for the collected data.

Here I have a sample and what I have to do is apologize for the pseudocode.

  ProjectModel: Owner = Furrenky (user) #only user users = too many users (users) #many users and can also be theoretically owner of   

Now I want to query to have a list of each user that the current user has a "people" in the projects.

I have no real clue how to do it. __ included really does not seem to be favorable for this ... so I think my options are basically just following down every project and making iterations myself but it would be more prosperous if I knew it How to get through ORM / SQL

Thank you!

# user in a project owned by the request. User = user.object Filter (projectmodel_downer = request.user) .distinct ()

If there are many M2 MMS there, and you related to your people area, you will use it in your reverse lookup instead of projectmodel . .

Comments