Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make related fields on ModelSerializer respect limit_choices_to #1811

Copy link
Copy link
Closed
@pipermerriam

Description

@pipermerriam
Issue body actions

The django ForeignKey fields support the keyword argument limit_choices_to, which when present, limits the available choices available by default when a ModelForm is created.

The serializer fields that represent relationships do not respect this keyword argument. I propose they should.

If accepted, it appears the place to do this would be in rest_framework.relations.RelatedField in the initialize method. Open to alternative suggestions on where/how to implement this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.