summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-12-06 23:12:32 -0500
committerChris McDonough <chrism@plope.com>2012-12-06 23:12:32 -0500
commit0920ac24a70df517afcf823b73ea58a1985fd44e (patch)
treeed8525d3d9118fe2aac7521ad0df14bed3b27ffb
parent3467d67092d34d870cee3129e8d6737cfe53c0a5 (diff)
downloadpyramid-0920ac24a70df517afcf823b73ea58a1985fd44e.tar.gz
pyramid-0920ac24a70df517afcf823b73ea58a1985fd44e.tar.bz2
pyramid-0920ac24a70df517afcf823b73ea58a1985fd44e.zip
make _backframes work like _depth (but still leave undocumented)
-rw-r--r--pyramid/util.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyramid/util.py b/pyramid/util.py
index ca7f5951c..a8f750a46 100644
--- a/pyramid/util.py
+++ b/pyramid/util.py
@@ -471,8 +471,9 @@ def viewdefaults(wrapped):
view = self.maybe_dotted(view)
if inspect.isclass(view):
defaults = getattr(view, '__view_defaults__', {}).copy()
+ if not '_backframes' in kw:
+ kw['_backframes'] = 1 # for action_method
defaults.update(kw)
- defaults['_backframes'] = 3 # for action_method
return wrapped(self, *arg, **defaults)
return functools.wraps(wrapped)(wrapper)
@@ -498,7 +499,7 @@ def action_method(wrapped):
self._ainfo = []
info = kw.pop('_info', None)
# backframes for outer decorators to actionmethods
- backframes = kw.pop('_backframes', 2)
+ backframes = kw.pop('_backframes', 0) + 2
if is_nonstr_iter(info) and len(info) == 4:
# _info permitted as extract_stack tuple
info = ActionInfo(*info)