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

Allowed Q objects in limit_choices_to introspection. #6472

Merged
merged 1 commit into from Feb 25, 2019

Conversation

carltongibson
Copy link
Collaborator

Closes #6470.

@carltongibson carltongibson added this to the 3.9.2 Release milestone Feb 25, 2019
@tomchristie
Copy link
Member

Ace 👍

@tomchristie tomchristie merged commit 8a29c53 into encode:master Feb 25, 2019
@carltongibson carltongibson deleted the issue/6470 branch February 25, 2019 11:11
@@ -251,7 +251,9 @@ def get_relation_kwargs(field_name, relation_info):

limit_choices_to = model_field and model_field.get_limit_choices_to()
if limit_choices_to:
kwargs['queryset'] = kwargs['queryset'].filter(**limit_choices_to)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carltongibson cool new feature. A question: it support use a callable like django ForeignKey.limit_choices_to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants