Ticket #5422: save-send-raw-flag.diff

File save-send-raw-flag.diff, 900 bytes (added by graham.carlyle@…, 17 years ago)

Passes raw flag from save to pre_save & post_save signal handlers

  • django/db/models/base.py

     
    202202    _prepare = classmethod(_prepare)
    203203
    204204    def save(self, raw=False):
    205         dispatcher.send(signal=signals.pre_save, sender=self.__class__, instance=self)
     205        dispatcher.send(signal=signals.pre_save, sender=self.__class__, instance=self, raw=raw)
    206206
    207207        non_pks = [f for f in self._meta.fields if not f.primary_key]
    208208        cursor = connection.cursor()
     
    259259        transaction.commit_unless_managed()
    260260
    261261        # Run any post-save hooks.
    262         dispatcher.send(signal=signals.post_save, sender=self.__class__, instance=self)
     262        dispatcher.send(signal=signals.post_save, sender=self.__class__, instance=self, raw=raw)
    263263
    264264    save.alters_data = True
    265265
Back to Top