Django

Code

Changeset 7218

Show
Ignore:
Timestamp:
03/10/08 21:48:39 (9 months ago)
Author:
mtredinnick
Message:

queryset-refactor: Fixed an oversight in Model.save() that was preventing updates to parent models beyond the initial save. Fixed #6706.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/django/db/models/base.py

    r7163 r7218  
    269269            setattr(self, field.attname, self._get_pk_val(parent._meta)) 
    270270 
    271         non_pks = [f for f in self._meta.local_fields if not f.primary_key] 
     271        non_pks = [f for f in meta.local_fields if not f.primary_key] 
    272272 
    273273        # First, try an UPDATE. If that doesn't update anything, do an INSERT. 
  • django/branches/queryset-refactor/tests/modeltests/model_inheritance/models.py

    r7179 r7218  
    129129 
    130130# Test the constructor for ItalianRestaurant. 
    131 >>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Elm', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4) 
     131>>> ir = ItalianRestaurant(name='Ristorante Miron', address='1234 W. Ash', serves_hot_dogs=False, serves_pizza=False, serves_gnocchi=True, rating=4) 
     132>>> ir.save() 
     133>>> ir.address = '1234 W. Elm' 
    132134>>> ir.save() 
    133135