#22838: ModelChoiceField.cache_choices
--------------------------------------+------------------------------------
Reporter: mjtamlyn | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by mjtamlyn):
* type: New feature => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
On further investigation and discussion with @bmispelon we have discovered
a few things.
The current implementation of `cache_choices` is pretty useless as it does
not share between multiple forms, only between multiple renderings of the
same form object. This is because of how we copy fields when moving from
`form.base_fields` to `form.fields`. As such, `cache_choices` as is should
be removed. Searching on github it appears to be unused "in the wild" and
I'd be inclined to remove it without deprecation - the deprecation cycle
would be tricky.
I'm reclassifying this ticket to just concern the removal of the "dead"
feature `cache_choices`. I'll open a new one with a more detailed
explanation of my motivations for new APIs for `ModelChoiceField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/22838#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.7be2370061f2bb7da6a521a858811f41%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.