Author: mtredinnick
Date: 2007-07-07 13:39:23 -0500 (Sat, 07 Jul 2007)
New Revision: 5631
Modified:
django/trunk/django/utils/decorators.py
Log:
Corrected misleading comment from [5619]. Not sure what I was smoking at the
time.
Modified: django/trunk/django/utils/decorators.py
===================================================================
--- django/trunk/django/utils/decorators.py 2007-07-07 18:24:27 UTC (rev
5630)
+++ django/trunk/django/utils/decorators.py 2007-07-07 18:39:23 UTC (rev
5631)
@@ -8,6 +8,9 @@
lets you use middleware functionality on a per-view basis.
"""
def _decorator_from_middleware(*args, **kwargs):
+ # For historical reasons, these "decorators" are also called as
+ # dec(func, *args) instead of dec(*args)(func). We handle both forms
+ # for backwards compatibility.
has_func = True
try:
view_func = kwargs.pop('view_func')
@@ -17,9 +20,7 @@
else:
has_func = False
if not (has_func and isinstance(view_func, types.FunctionType)):
- # For historical reasons, these decorators are also called as
- # dec(func, *args) instead of dec(*args)(func). This branch handles
- # the backwards compatibility.
+ # We are being called as a decorator.
if has_func:
args = (view_func,) + args
middleware = middleware_class(*args, **kwargs)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---