summaryrefslogtreecommitdiff
path: root/django/utils/tree.py
diff options
context:
space:
mode:
authorxuxiang <dlutxx@gmail.com>2013-11-20 10:02:30 +0800
committerSimon Charette <charette.s@gmail.com>2013-11-19 23:08:21 -0500
commit4cfe6ba6a3d16a16f0561f2f3c5b56d117f8a60d (patch)
tree4032334140f2c73906e9b72a527aea626397dda5 /django/utils/tree.py
parent73b3c257e339985f2ab009c3ccf9a74be9e1d134 (diff)
Use `classmethod` as a decorator.
Diffstat (limited to 'django/utils/tree.py')
-rw-r--r--django/utils/tree.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/tree.py b/django/utils/tree.py
index 381dcdd06c..16389d0507 100644
--- a/django/utils/tree.py
+++ b/django/utils/tree.py
@@ -27,6 +27,7 @@ class Node(object):
# We need this because of django.db.models.query_utils.Q. Q. __init__() is
# problematic, but it is a natural Node subclass in all other respects.
+ @classmethod
def _new_instance(cls, children=None, connector=None, negated=False):
"""
This is called to create a new instance of this class when we need new
@@ -39,7 +40,6 @@ class Node(object):
obj = Node(children, connector, negated)
obj.__class__ = cls
return obj
- _new_instance = classmethod(_new_instance)
def __str__(self):
if self.negated: