My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 10 attachment: signal_raw_save.diff (743 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: mptt/signals.py
===================================================================
--- mptt/signals.py (revision 91)
+++ mptt/signals.py (working copy)
@@ -39,7 +39,7 @@
pass
return right_sibling

-def pre_save(instance):
+def pre_save(instance, **kwargs):
"""
If this is a new node, sets tree fields up before it is inserted
into the database, making room in the tree structure as neccessary,
@@ -57,6 +57,8 @@
tree option set, the node will be inserted or moved to the
appropriate position to maintain ordering by the specified field.
"""
+ if kwargs.get('raw'):
+ return
opts = instance._meta
parent = getattr(instance, opts.parent_attr)
if not instance.pk:
Powered by Google Project Hosting