[Django] #26999: Request to add changes to ``model_to_dict`` in Django 1.10 to the release notes

3 views
Skip to first unread message

Django

unread,
Aug 2, 2016, 5:58:05 PM8/2/16
to django-...@googlegroups.com
#26999: Request to add changes to ``model_to_dict`` in Django 1.10 to the release
notes
-------------------------------+--------------------
Reporter: aronysidoro | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/26999>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 2, 2016, 7:24:56 PM8/2/16
to django-...@googlegroups.com
#26999: Request to add changes to ``model_to_dict`` in Django 1.10 to the release
notes
--------------------------------------+------------------------------------
Reporter: aronysidoro | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

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:
{{{
* Private API ``django.forms.models.model_to_dict()`` returns a queryset
for
``ManyToManyField``\s rather than a list of IDs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26999#comment:1>

Django

unread,
Aug 3, 2016, 8:54:16 AM8/3/16
to django-...@googlegroups.com
#26999: Request to add changes to ``model_to_dict`` in Django 1.10 to the release
notes
--------------------------------------+------------------------------------
Reporter: aronysidoro | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"f4b1f972dc69e519a78182353e43701a17bb43aa" f4b1f972]:
{{{
#!CommitTicketReference repository=""
revision="f4b1f972dc69e519a78182353e43701a17bb43aa"
Fixed #26999 -- Documented model_to_dict() ManyToManyField change in 1.10.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26999#comment:2>

Django

unread,
Aug 3, 2016, 8:54:26 AM8/3/16
to django-...@googlegroups.com
#26999: Request to add changes to ``model_to_dict`` in Django 1.10 to the release
notes
--------------------------------------+------------------------------------
Reporter: aronysidoro | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b00a3f17209789fd6036aa93194c04b05f51047a" b00a3f17]:
{{{
#!CommitTicketReference repository=""
revision="b00a3f17209789fd6036aa93194c04b05f51047a"
[1.10.x] Fixed #26999 -- Documented model_to_dict() ManyToManyField change
in 1.10.

Backport of f4b1f972dc69e519a78182353e43701a17bb43aa from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26999#comment:3>

Reply all
Reply to author
Forward
0 new messages