#26260: Support of object_list in ModelChoiceField and ModelMultipleChoiceField
-----------------------------+--------------------------------------
Reporter: srkunze | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by srkunze):
* status: closed => new
* resolution: needsinfo =>
Comment:
Sure, recreating a queryset from the object list is also our current
approach.
We could identify two issues so far:
1) code duplication (already observed)
2) performance
Number 2) worries me most as we observed performance issues recently. So,
this only contributes further.
Perhaps it would help when I explain our use-case.
We designed tree widgets for both choice and multiple choice fields. They
work quite well when all items can be expressed easily on terms a regular
queryset. However, as you can imagine, tree data enables some pretty
interesting and complex use-cases. So, the object list is built
differently here.
Currently, we cheat by using the ModelChoiceIterator as it exposes the
original queryset to the widget.
--
Ticket URL: <https://code.djangoproject.com/ticket/26260#comment:5>
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/065.dd56b4c00d16e1853542e82e2898aee4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.