On Nov 17, 2013, at 2:02 AM, Anssi Kääriäinen <[email protected]> wrote:
> - Reverse ForeignKey .remove() will not use .save() - it will use .update()
> - so no model save signals, and overridden model.save() is missed, too.
+1 on the pre/post_update signals as they can be useful for a variety of
purposes.
Although as an upgrade path, anyone who cares about the save signals and save()
method can replace rel.remove(*objs) by the following snippet to replicate the
old behavior:
for obj in objs:
obj.fk = None
obj.save()
This is similar to the recommendation we document for custom delete() methods
and QuerySet.delete():
"If you’ve provided a custom delete() method on a model class and want to
ensure that it is called, you will need to “manually” delete instances of that
model (e.g., by iterating over a QuerySet and calling delete() on each object
individually) rather than using the bulk delete() method of a QuerySet."
--
Loic
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CFEF3A8E-730D-4AA4-B0E9-BCEB93F34330%40sixmedia.com.
For more options, visit https://groups.google.com/groups/opt_out.