Browse files

Removed some unused code and improved docstring on auto_adapt_to_methods

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent ca9d013 commit 175ab92d6b96f430d3a38fadac6e4cab2a34c053 @spookylukey spookylukey committed Oct 1, 2009
Showing with 4 additions and 6 deletions.
  1. +4 −6 django/utils/
@@ -23,14 +23,12 @@ def __call__(self, *args, **kwargs):
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)

0 comments on commit 175ab92

Please sign in to comment.