Author: utrebec
Date: 2006-08-16 07:52:35 -0500 (Wed, 16 Aug 2006)
New Revision: 3595
Modified:
django/branches/full-history/django/db/models/base.py
django/branches/full-history/django/db/models/query.py
Log:
[full-history]
* Added a "signal_name" argument to "pre_save" and "pre_delete" signals
(I use it so I can use single function to catch both signals and still
do different things with them)
Modified: django/branches/full-history/django/db/models/base.py
===================================================================
--- django/branches/full-history/django/db/models/base.py 2006-08-16
06:29:22 UTC (rev 3594)
+++ django/branches/full-history/django/db/models/base.py 2006-08-16
12:52:35 UTC (rev 3595)
@@ -160,7 +160,7 @@
_prepare = classmethod(_prepare)
def save(self):
- dispatcher.send(signal=signals.pre_save, sender=self.__class__,
instance=self)
+ dispatcher.send(signal=signals.pre_save, sender=self.__class__,
instance=self, signal_name='pre_save')
non_pks = [f for f in self._meta.fields if not f.primary_key]
cursor = connection.cursor()
Modified: django/branches/full-history/django/db/models/query.py
===================================================================
--- django/branches/full-history/django/db/models/query.py 2006-08-16
06:29:22 UTC (rev 3594)
+++ django/branches/full-history/django/db/models/query.py 2006-08-16
12:52:35 UTC (rev 3595)
@@ -921,7 +921,7 @@
# Pre notify all instances to be deleted
for pk_val, instance in seen_objs[cls]:
- dispatcher.send(signal=signals.pre_delete, sender=cls,
instance=instance)
+ dispatcher.send(signal=signals.pre_delete, sender=cls,
instance=instance, signal_name='pre_delete')
pk_list = [pk for pk,instance in seen_objs[cls]]
for related in cls._meta.get_all_related_many_to_many_objects():
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---