Author: mtredinnick
Date: 2007-10-15 18:01:18 -0500 (Mon, 15 Oct 2007)
New Revision: 6523

Modified:
   django/branches/queryset-refactor/django/db/models/query.py
   django/branches/queryset-refactor/tests/modeltests/signals/models.py
Log:
queryset-refactor: Changed post_delete signal behaviour back to match trunk's
version (it wasn't in error after all).


Modified: django/branches/queryset-refactor/django/db/models/query.py
===================================================================
--- django/branches/queryset-refactor/django/db/models/query.py 2007-10-15 
06:51:37 UTC (rev 6522)
+++ django/branches/queryset-refactor/django/db/models/query.py 2007-10-15 
23:01:18 UTC (rev 6523)
@@ -544,9 +544,9 @@
                 if field.rel and field.null and field.rel.to in seen_objs:
                     setattr(instance, field.attname, None)
 
-            setattr(instance, cls._meta.pk.attname, None)
             dispatcher.send(signal=signals.post_delete, sender=cls,
                     instance=instance)
+            setattr(instance, cls._meta.pk.attname, None)
 
     transaction.commit_unless_managed()
 

Modified: django/branches/queryset-refactor/tests/modeltests/signals/models.py
===================================================================
--- django/branches/queryset-refactor/tests/modeltests/signals/models.py        
2007-10-15 06:51:37 UTC (rev 6522)
+++ django/branches/queryset-refactor/tests/modeltests/signals/models.py        
2007-10-15 23:01:18 UTC (rev 6523)
@@ -54,7 +54,7 @@
 pre_delete signal, Tom Smith
 instance.id is not None: True
 post_delete signal, Tom Smith
-instance.id is None: True
+instance.id is None: False
 
 >>> p2 = Person(first_name='James', last_name='Jones')
 >>> p2.id = 99999
@@ -73,7 +73,7 @@
 pre_delete signal, James Jones
 instance.id is not None: True
 post_delete signal, James Jones
-instance.id is None: True
+instance.id is None: False
 
 >>> Person.objects.all()
 [<Person: James Jones>]


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to