summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2011-04-20 05:04:22 -0500
committerMichael Merickel <michael@merickel.org>2011-04-20 05:05:41 -0500
commite5bd53104342e6bf241d215424a9d8058cbb5941 (patch)
tree511715d457601da04f6fbbcbb54cf609bd352097
parenta636c683b150d9bbd9201a98849f13eef39a85f2 (diff)
downloadpyramid-e5bd53104342e6bf241d215424a9d8058cbb5941.tar.gz
pyramid-e5bd53104342e6bf241d215424a9d8058cbb5941.tar.bz2
pyramid-e5bd53104342e6bf241d215424a9d8058cbb5941.zip
Provided a possible fix for StaticURLInfo.
-rw-r--r--pyramid/static.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/pyramid/static.py b/pyramid/static.py
index 223652768..9e53c034a 100644
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -148,13 +148,26 @@ class StaticURLInfo(object):
permission = extra.pop('permission', None)
if permission is None:
permission = '__no_permission_required__'
- extra['view_permission'] = permission
- extra['view'] = view
+
+ context = extra.pop('view_context', None)
+ if context is None:
+ context = extra.pop('view_for', None)
+ if context is None:
+ context = extra.pop('for_', None)
+
+ renderer = extra.pop('view_renderer', None)
+ if renderer is None:
+ renderer = extra.pop('renderer', None)
+
+ attr = extra.pop('view_attr', None)
# register a route using the computed view, permission, and
# pattern, plus any extras passed to us via add_static_view
pattern = "%s*subpath" % name # name already ends with slash
self.config.add_route(name, pattern, **extra)
+ self.config.add_view(route_name=name, view=view,
+ permission=permission, context=context,
+ renderer=renderer, attr=attr)
self.registrations.append((name, spec, False))
class static_view(object):