-
-
Notifications
You must be signed in to change notification settings - Fork 458
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 ForeignKey queryset filters for cases where the to argument is a … #1436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but this would need a test case.
Sure! Apparently it has also broken a bunch of things, I will take a look into that. |
faf0ce4
to
e9925e4
Compare
I have switched approaches here a little because I discovered this only applies when abstract base classes are involved. From the docs:
I have changed the logic to accommodate for this and added a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Just one nit left :)
8868b6a
to
d9e0136
Compare
…string like 'app_label.model_name'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
…string like 'app_label.model_name'.
I have made things!
Related issues
Refs #626 (probably closes, but my use case is only similar, not exactly the same.
This fixes lookups for related_cls where it was assumed the
to
field on a foreign key would always be a class. If it is a string however (usingapp_label.model_name
notation), this breaks some things.