My favorites
▼
|
Sign in
django-mptt
Utilities for implementing Modified Preorder Tree Traversal
Project Home
Downloads
Wiki
Issues
Source
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
30
attachment: mptt-for-django-1.0.patch
(2.6 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff -urN django-mptt-0.2.1.orig/mptt/forms.py django-mptt-0.2.1/mptt/forms.py
--- django-mptt-0.2.1.orig/mptt/forms.py 2008-01-16 19:54:58.000000000 +0100
+++ django-mptt-0.2.1/mptt/forms.py 2008-09-05 16:08:53.000000000 +0200
@@ -1,9 +1,9 @@
"""
Form components for working with trees.
"""
-from django import newforms as forms
-from django.newforms.forms import NON_FIELD_ERRORS
-from django.newforms.util import ErrorList
+from django import forms
+from django.forms.forms import NON_FIELD_ERRORS
+from django.forms.util import ErrorList
from django.utils.translation import ugettext_lazy as _
from mptt.exceptions import InvalidMove
Binary files django-mptt-0.2.1.orig/mptt/.forms.py.swp and django-mptt-0.2.1/mptt/.forms.py.swp differ
diff -urN django-mptt-0.2.1.orig/mptt/__init__.py django-mptt-0.2.1/mptt/__init__.py
--- django-mptt-0.2.1.orig/mptt/__init__.py 2008-01-16 19:56:04.000000000 +0100
+++ django-mptt-0.2.1/mptt/__init__.py 2008-09-05 16:08:12.000000000 +0200
@@ -1,6 +1,5 @@
from django.db.models import signals as model_signals
from django.db.models import FieldDoesNotExist, PositiveIntegerField
-from django.dispatch import dispatcher
from django.utils.translation import ugettext as _
from mptt import models
@@ -70,5 +69,5 @@
# Set up signal receivers to manage the tree when instances of the
# model are about to be created, have their parent changed or be
# deleted.
- dispatcher.connect(pre_save, signal=model_signals.pre_save, sender=model)
- dispatcher.connect(pre_delete, signal=model_signals.pre_delete, sender=model)
+ model_signals.pre_save.connect(receiver=pre_save, sender=model)
+ model_signals.pre_delete.connect(receiver=pre_delete, sender=model)
diff -urN django-mptt-0.2.1.orig/mptt/signals.py django-mptt-0.2.1/mptt/signals.py
--- django-mptt-0.2.1.orig/mptt/signals.py 2008-01-16 19:54:58.000000000 +0100
+++ django-mptt-0.2.1/mptt/signals.py 2008-09-05 16:05:54.000000000 +0200
@@ -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,
@@ -96,7 +96,7 @@
# restored on the way out in case of errors.
setattr(instance, opts.parent_attr, parent)
-def pre_delete(instance):
+def pre_delete(instance, **kwargs):
"""
Updates tree node edge indicators which will by affected by the
deletion of the given model instance and any descendants it may
Powered by
Google Project Hosting