Ticket #2154: insert_update_signals2.diff
File insert_update_signals2.diff, 1.4 KB (added by , 18 years ago) |
---|
-
db/models/base.py
167 167 ','.join(['%s=%%s' % backend.quote_name(f.column) for f in non_pks]), 168 168 backend.quote_name(self._meta.pk.attname)), 169 169 db_values + [pk_val]) 170 dispatcher.send(signal=signals.save_update, 171 sender=self.__class__, instance=self) 170 172 else: 171 173 record_exists = False 172 174 if not pk_set or not record_exists: … … 195 197 backend.get_pk_default_value())) 196 198 if self._meta.has_auto_field and not pk_set: 197 199 setattr(self, self._meta.pk.attname, backend.get_last_insert_id(cursor, self._meta.db_table, self._meta.pk.column)) 200 dispatcher.send(signal=signals.save_insert, sender=self.__class__, 201 instance=self) 198 202 transaction.commit_unless_managed() 199 203 200 204 # Run any post-save hooks. -
db/models/signals.py
4 4 post_init = object() 5 5 6 6 pre_save = object() 7 save_update = object() 8 save_insert = object() 7 9 post_save = object() 8 10 9 11 pre_delete = object()