mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
* 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:
parent
1426c24517
commit
12716794db
9 changed files with 232 additions and 13 deletions
|
@ -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')
|
||||
[<ItalianRestaurant: Ristorante Miron the italian restaurant>]
|
||||
|
||||
>>> ir.address = '1234 W. Elm'
|
||||
>>> ir.save()
|
||||
>>> ItalianRestaurant.objects.filter(address='1234 W. Elm')
|
||||
[<ItalianRestaurant: Ristorante Miron the italian restaurant>]
|
||||
|
||||
# Make sure Restaurant and ItalianRestaurant have the right fields in the right
|
||||
# order.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue