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

ambiguous column exception in _get_query in connection_field.py #51

Open
maquino1985 opened this issue Mar 9, 2021 · 1 comment
Open

Comments

@maquino1985
Copy link
Contributor

the query generated by subquery when using filters unambiguously labeling columns resulting in an ambiguous column exception.

long story short, I have a polymorphic database, so id is shared between a base class and the filtered child class. that seems to be the root of the issue. after playing around for a while I found subquery.subquery() has a with_labels argument you can pass. setting that to True fixed the issue for me

e.g. connection_field.py line 250

      aliased_model = aliased(self.model, subquery.subquery(with_labels=True))
@maquino1985
Copy link
Contributor Author

hey @art1415926535 can you look at this and/or add this? I don't want to make another forked library to maintain and this simple change fixes a critical issue and should cause no side effects

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

1 participant