diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-15 23:01:18 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-15 23:01:18 +0000 |
| commit | 1e1230c41c428c3909b52720e381cac18942e90e (patch) | |
| tree | 32e2b57d56bd79d19e9ec14bacd7ea376340970a | |
| parent | 91b1369709eb5d5602ce03432a5a342771d95c92 (diff) | |
queryset-refactor: Changed post_delete signal behaviour back to match trunk's
version (it wasn't in error after all).
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/models/query.py | 2 | ||||
| -rw-r--r-- | tests/modeltests/signals/models.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index a1a2428651..c36a68f404 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -544,9 +544,9 @@ def delete_objects(seen_objs): 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() diff --git a/tests/modeltests/signals/models.py b/tests/modeltests/signals/models.py index d41142135e..1fb73828bb 100644 --- a/tests/modeltests/signals/models.py +++ b/tests/modeltests/signals/models.py @@ -54,7 +54,7 @@ Is updated 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 @@ Is created 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>] |
