Django

Code

Ticket #3741 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

Serializers don't work with GenericRelations

Reported by: russellm Assigned to: russellm
Milestone: Component: Serialization
Version: SVN Keywords: Generic Relation
Cc: alexander.solovyov@gmail.com Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Alexander Solovyov <alexander.solovyov@gmail.com> 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.

Attachments

Change History

03/15/07 18:18:14 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

03/16/07 03:35:22 changed by anonymous

  • cc set to alexander.solovyov@gmail.com.

03/19/07 06:57:54 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3741 (Serializers don't work with GenericRelations)




Change Properties
Action