#24227: isinstance checks on ManyToManyField should be replaced with
field.many_to_many
-------------------------------------+-------------------------------------
Reporter: coldmind | Owner: coldmind
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by collinanderson):
I have a pull request here which I believe reverts the problematic parts
of the original change. https://github.com/django/django/pull/6582
There are 2 code branches which are basically just hacks to make the
current ManyToManyFields work properly:
- in forms/models.py, `model_to_dict` converts a `qs` into a list of
`pk`s.
- in admin/options.py, `get_changeform_initial_data` splits a string on
commas `','`
Custom form fields should handle this behavior themselves (if they want
this behavior, which shouldn't be assumed).
The other code paths are for wrapping the form field in
`ManyToManyRawIdWidget` or other widgets, and I a custom field will want a
custom widget.
--
Ticket URL: <https://code.djangoproject.com/ticket/24227#comment:17>
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.9af0c9fbd9aa037d4c4273591fcb9760%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.