-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix: Relationships on subquery model. #1
Conversation
Hmm this actually breaks still on the ManyToOne relations... |
Maybe change it to: declared = {f.column for f in model._meta.get_fields() if f.concrete} But that needs some tests. |
Fixed it by adding a shelve model to keep books on, so that there is a non concrete manytomany field on the book model to throw the expected |
Ugh, the other side of a manytomany is a concrete field with a column that isn't actually in the database. (default django user groups field) Which is weird? |
…ctual column instead of the name.
Only concrete fields should be used.
d887afc
to
39394a5
Compare
(I've merged |
No problem, seems I sort is failing, but no clear error. I'll have a look later when I have time. |
I think it doesn't like the empty line you removed in testproject/testapp/models.py. Do you have an automatic isort in your text editor? Which config does that use? |
I think I might have ruff configured with default settings, not sure and not at my dev laptop right now to check. |
I think I'm going to make isort happy then merge this. Seems like a net positive. |
Thanks again for the contribution! 🚀 |
It was using the field name instead of the field column which resulted in errors for related fields.
This way other related models work as excepted, but it will issue a query.