#26999 closed Cleanup/optimization (fixed)
Request to add changes to ``model_to_dict`` in Django 1.10 to the release notes
Reported by: | Aaron Lelevier | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
It seems that the django.forms.models.model_to_dict
function changed with the way that it treats many-to-many related objects. Before, it was returning them in a list if ID's. Not it's returning them as a queryset.
Commit that caused the change:
https://github.com/django/django/commit/ded502024191053475bac811d365ac29dca1db61
The logic is here in the model_to_dict
method:
https://github.com/django/django/blob/1.10/django/forms/models.py#L91
And here in the field method:
https://github.com/django/django/blob/1.10/django/db/models/fields/related.py#L1564-L1570
I'd like to request to add this to the release notes for Django 1.10. I couldn't find any note of it in there. I didn't know about the change, and it caused some code to break. No big deal, was able to locate the issue. Just want to point it out in case others may experience it.
Thank you
Change History (3)
comment:1 by , 8 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
We don't normally document private API changes, however, my sense is that
model_to_dict()
is widely used even though it's not documented. How about: