Opened 9 years ago

Closed 9 years ago

#3741 closed (fixed)

Serializers don't work with GenericRelations

Reported by: russellm Owned by: russellm
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:


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>

Which, by inspection, is ambiguous.

Change History (3)

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 9 years ago by anonymous

  • Cc alexander.solovyov@… added

comment:3 Changed 9 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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