Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability of tables joining #147

Open
M1ha-Shvn opened this issue Jun 2, 2020 · 1 comment
Open

Ability of tables joining #147

M1ha-Shvn opened this issue Jun 2, 2020 · 1 comment

Comments

@M1ha-Shvn
Copy link
Contributor

M1ha-Shvn commented Jun 2, 2020

Hi.
I don't see any way nowadays of joining tables in QuerySets. Is anything planned in this direction?

@ishirav
Copy link
Contributor

ishirav commented Jun 2, 2020

I don't have anything planned in this area, the main challenge I think is choosing a syntax for this which is both convenient and flexible enough. Perhaps something like:

qs = Person.objects_in(db).filter(Person.gender == 'F')
qs = qs.join(LEFT_OUTER, Pet, Pet.owner_id == Person.id)

where the join method expects the join type, the model (or queryset?) to join with, and the conditions for joining (the ON expressions).
More thinking is needed to see if this is good enough for more complex cases, such as multiple joins in one query, or a table that is joined with itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants