[Django] #28725: The serializer will output the many-to-many field in the parent class.

10 views
Skip to first unread message

Django

unread,
Oct 19, 2017, 3:40:30 AM10/19/17
to django-...@googlegroups.com
#28725: The serializer will output the many-to-many field in the parent class.
------------------------------------------------+------------------------
Reporter: 宅教授 | Owner: nobody
Type: Bug | Status: new
Component: Core (Serialization) | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
models:
{{{
class Root(Model):
varchar_field_a
many_to_many_field

class Sub(Root):
varchar_field_b
}}}

cmd: `python manager.py dumpdata`, output:
{{{
[
{
"pk": 1,
"model": "label.sub",
"fields": {
"varchar_field_b": "b",
"many_to_many_field": [...]
}
},
...
]
}}}

The point is, its export the many-to-many field in the parent class.
cmd: `python manager.py loaddata`, import the above data. Triggered by
repeated import many-to-many data uniqueness constraints.

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

Django

unread,
Oct 24, 2017, 10:26:54 PM10/24/17
to django-...@googlegroups.com
#28725: In multi-table inheritance, serializers output ManyToManyFields in both the
parent and the base class which causes an error with loaddata
--------------------------------------+------------------------------------

Reporter: 宅教授 | Owner: nobody
Type: Bug | Status: new
Component: Core (Serialization) | Version: 1.11
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 Tim Graham):

* stage: Unreviewed => Accepted


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

Django

unread,
Jun 23, 2019, 10:52:17 AM6/23/19
to django-...@googlegroups.com
#28725: In multi-table inheritance, serializers output ManyToManyFields in both the
parent and the base class which causes an error with loaddata
--------------------------------------+------------------------------------
Reporter: 宅教授 | Owner: Nadege
Type: Bug | Status: assigned

Component: Core (Serialization) | Version: 1.11
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 Nadege):

* owner: nobody => Nadege
* status: new => assigned


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

Django

unread,
Jun 27, 2019, 4:02:28 AM6/27/19
to django-...@googlegroups.com
#28725: In multi-table inheritance, serializers output ManyToManyFields in both the
parent and the base class which causes an error with loaddata
--------------------------------------+------------------------------------
Reporter: 宅教授 | Owner: Nadege
Type: Bug | Status: assigned
Component: Core (Serialization) | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Nadege):

* has_patch: 0 => 1


Comment:

hi here is the patch [https://github.com/django/django/pull/11518 PR]
Not sure about the release it should target though.

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

Django

unread,
Jun 27, 2019, 9:57:38 AM6/27/19
to django-...@googlegroups.com
#28725: In multi-table inheritance, serializers output ManyToManyFields in both the
parent and the base class which causes an error with loaddata
-------------------------------------+-------------------------------------

Reporter: 宅教授 | Owner: Nadege
Type: Bug | Status: assigned
Component: Core | Version: master
(Serialization) |
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
-------------------------------------+-------------------------------------
Changes (by felixxm):

* version: 1.11 => master
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28725#comment:4>

Django

unread,
Jun 27, 2019, 9:58:53 AM6/27/19
to django-...@googlegroups.com
#28725: In multi-table inheritance, serializers output ManyToManyFields in both the
parent and the base class which causes an error with loaddata
-------------------------------------+-------------------------------------
Reporter: 宅教授 | Owner: Nadege
Type: Bug | Status: closed

Component: Core | Version: master
(Serialization) |
Severity: Normal | Resolution: fixed

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
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"895b15771e5b6c48df45d11ef9ce41678639974c" 895b1577]:
{{{
#!CommitTicketReference repository=""
revision="895b15771e5b6c48df45d11ef9ce41678639974c"
Fixed #28725 -- Prevented serializing inherited ManyToManyFields in child
model.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28725#comment:5>

Reply all
Reply to author
Forward
0 new messages