Opened 10 years ago

Closed 10 years ago

#3741 closed (fixed)

Serializers don't work with GenericRelations

Reported by: Russell Keith-Magee Owned by: Russell Keith-Magee
Component: Core (Serialization) Version: master
Severity: Keywords: Generic Relation
Cc: alexander.solovyov@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Alexander Solovyov <alexander.solovyov@…> reports that a model with a GenericRelation doesn't serialize properly; he has tried XML, JSON,and python serializers, and has problems with all of them. Under XML, for example, he gets:

Problem installing fixture 'product/fixtures/initial_data.xml': 'int' object has no attribute 'content_type'

The generic relation serializes as:

<field to="tag.taggeditem" name="tags" rel="GenericRel">
 <object pk="10"></object>
 <object pk="11"></object>
</field>

Which, by inspection, is ambiguous.

Change History (3)

comment:1 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by anonymous

Cc: alexander.solovyov@… added

comment:3 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [4752]) Fixed #3741 -- Fixed serialization of GenericRelations. Thanks for the report, Alexander Solovyov.

Note: See TracTickets for help on using tickets.
Back to Top