1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #7350, #7202 -- Fixed serialization for multi-model inheritance, which had multiple problems:

* Serializers were including all superclass fields in their output. Now only local fields are included.
 * Implicit OneToOne primary keys were not correctly added to the metamodel, so they were always marked to be serialized, even though they were primary
 * Model saving was too aggressive about creating new parent class instances during deserialization. Raw save on a model now skips saving of the parent class.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2008-06-09 14:03:35 +00:00
parent 1426c24517
commit 12716794db
9 changed files with 232 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ class Serializer(object):
self.start_serialization()
for obj in queryset:
self.start_object(obj)
for field in obj._meta.fields:
for field in obj._meta.local_fields:
if field.serialize:
if field.rel is None:
if self.selected_fields is None or field.attname in self.selected_fields: