Ticket #7245: propagate-all-pk-values-7245.patch

File propagate-all-pk-values-7245.patch, 678 bytes (added by m.gajda@…, 16 years ago)

Propagate all pk values patch

  • django/db/models/manipulators.py

     
    9595            params[f.attname] = param
    9696
    9797        if self.change:
    98             params[self.opts.pk.attname] = self.obj_key
     98            def propagate_pks( opts ):
     99                params[opts.pk.attname] = self.obj_key
     100                for p in opts.parents.keys():
     101                    propagate_pks( p._meta )
     102            propagate_pks( self.opts )
    99103
    100104        # First, create the basic object itself.
    101105        new_object = self.model(**params)
Back to Top