Skip to content

Remove ChainedFieldsMixin #3912

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

Closed
hSaria opened this issue Jan 13, 2020 · 2 comments · Fixed by #4136
Closed

Remove ChainedFieldsMixin #3912

hSaria opened this issue Jan 13, 2020 · 2 comments · Fixed by #4136
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@hSaria
Copy link
Contributor

hSaria commented Jan 13, 2020

Proposed Changes

Remove the ChainedFieldsMixin, ChainedModelChoiceField, and ChainedModelMultipleChoiceField.

Justification

Chaining has been replaced with APISelect's filter_for and is no longer required. It updates the queryset, but it is entirely ignored by the API call. And ever since #3812, only the selected option (if any) in the queryset is rendered, so limiting makes very little difference.

@jeremystretch
Copy link
Member

This isn't as simple as just ripping out the chained fields logic, unfortunately. There's more going on here than UI rendering: Foreign key fields frequently need to have their querysets limited in various scenarios to avoid thrashing the database during form validation. It's no doubt something we should look into eventually but it's a huge project and not a priority at this time.

@hSaria
Copy link
Contributor Author

hSaria commented Feb 10, 2020

With #4108 implemented, would it now be safe to remove chaining as the APISelect now limits the queryset to only the existing selection?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
2 participants