Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

queryset-refactor: Fixed an oversight in that was preven…

…ting updates to parent models beyond the initial save. Fixed #6706.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit df8e3e65127252d31417856054d7a2fe3b41fb00 1 parent f2f9334
@malcolmt malcolmt authored
2  django/db/models/
@@ -268,7 +268,7 @@ def save(self, raw=False, cls=None):, parent)
setattr(self, field.attname, self._get_pk_val(parent._meta))
- non_pks = [f for f in self._meta.local_fields if not f.primary_key]
+ non_pks = [f for f in meta.local_fields if not f.primary_key]
# First, try an UPDATE. If that doesn't update anything, do an INSERT.
pk_val = self._get_pk_val(meta)
4 tests/modeltests/model_inheritance/
@@ -128,7 +128,9 @@ def __unicode__(self):
# Test the constructor for ItalianRestaurant.
->>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Elm', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4)
+>>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Ash', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4)
+>>> ir.address = '1234 W. Elm'
# Make sure Restaurant and ItalianRestaurant have the right fields in the right
Please sign in to comment.
Something went wrong with that request. Please try again.