summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-10-01 16:15:27 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-10-01 16:15:27 +0000
commit175ab92d6b96f430d3a38fadac6e4cab2a34c053 (patch)
tree7f3701cb9dfae00c9196306c027b852d48e6eb80
parentca9d0136df5206a6c988e2826fa0938449363a3d (diff)
Removed some unused code and improved docstring on auto_adapt_to_methods
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/decorators.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/django/utils/decorators.py b/django/utils/decorators.py
index c22c01ac09..4636a2d040 100644
--- a/django/utils/decorators.py
+++ b/django/utils/decorators.py
@@ -23,14 +23,12 @@ class MethodDecoratorAdaptor(object):
return self.decorator(self.func)(*args, **kwargs)
def __get__(self, instance, owner):
return self.decorator(self.func.__get__(instance, owner))
- def _get_name(self):
- return self.func.__name__
- def _get_doc(self):
- return self.func.__doc__
def auto_adapt_to_methods(decorator):
- """Allows you to use the same decorator on methods and functions,
- hiding the self argument from the decorator."""
+ """
+ Takes a decorator function, and returns a decorator-like callable that can
+ be used on methods as well as functions.
+ """
def adapt(func):
return MethodDecoratorAdaptor(decorator, func)
return wraps(decorator)(adapt)