From 12716794dbcf2e1bf7a07bd18dfc0ae24be4e6f8 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 9 Jun 2008 14:03:35 +0000 Subject: 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 --- tests/modeltests/model_inheritance/models.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/modeltests') diff --git a/tests/modeltests/model_inheritance/models.py b/tests/modeltests/model_inheritance/models.py index b1a751f5e8..7c737b6bd1 100644 --- a/tests/modeltests/model_inheritance/models.py +++ b/tests/modeltests/model_inheritance/models.py @@ -147,8 +147,13 @@ Test constructor for Restaurant. >>> c.save() >>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Ash', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4, chef=c) >>> ir.save() +>>> ItalianRestaurant.objects.filter(address='1234 W. Ash') +[] + >>> ir.address = '1234 W. Elm' >>> ir.save() +>>> ItalianRestaurant.objects.filter(address='1234 W. Elm') +[] # Make sure Restaurant and ItalianRestaurant have the right fields in the right # order. -- cgit v1.3