sehughes / django-treebeard

Automatically exported from code.google.com/p/django-treebeard
Apache License 2.0
0 stars 0 forks source link

Do not call parent node's save when children are added, moved or deleted #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, when a node is deleted, added or moved, some attributes of the 
parent node obviously 
need to be updated to reflect changes in the hierarchy. Could this be done in a 
way that doesn't 
call the model's save() method though? When save() is called, usually the 
modified date field will 
be updated and pre_save and post_save signals called which will cause some 
slight but unwanted 
side effects - i.e. I don't want a parent's modified date to be reset when its 
children are reordered.

Original issue reported on code.google.com by eallik on 10 Sep 2009 at 12:14

GoogleCodeExporter commented 9 years ago
This is because of proably my least-favorite feature of django: blindly 
updating all fields in an object. Hopefully 
http://code.djangoproject.com/ticket/4102 will be accepted soon. Meanwhile, if 
this is a problem, I'd suggest 
the use of a customized "last updated" field (one that isn't updated on .save() 
).

Original comment by gpicon on 4 Oct 2009 at 1:18