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

Remove the model class argument from Relation #3

Closed
daisylb opened this issue Jan 8, 2018 · 2 comments
Closed

Remove the model class argument from Relation #3

daisylb opened this issue Jan 8, 2018 · 2 comments

Comments

@daisylb
Copy link
Owner

daisylb commented Jan 8, 2018

Currently, Relation has the signature Relation(attribute_name, model_class, rule). Having the model_class argument is kind of a pain; ideally, Relation and Attribute should have matching signatures, and we should figure out the model class to construct a QuerySet from when .query() is called. (What would really be ideal is if we could pass a Q object directly into {attr}__in, but Django doesn't let us do that.)

@daisylb daisylb added this to the 1.x milestone Jan 8, 2018
@daisylb
Copy link
Owner Author

daisylb commented Mar 12, 2018

ManyRelation is even uglier: it takes four args, when really it should just take two.

@daisylb
Copy link
Owner Author

daisylb commented Jul 18, 2019

This message on django-developers gives a function that adds a prefix to everything in a Q object, which should have the same effect as being able to go Q(foo__in=Q(...)).

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

No branches or pull requests

1 participant