Commits

imbolc committed 6af9db9

context fix

  • Participants
  • Parent commits c840bfb

Comments (0)

Files changed (3)

     
     def add_rule(self, url, target, name=None):
         if self.url_prefix:
-            url = '/%s/%s' % (self.url_prefix.strip('/'), url.lstrip('/'))
+            url = '/%s/%s' % (self.url_prefix, url.lstrip('/'))
         dirs = url.split('/')[1:]
         cur = self.tree
         vars = []
     for mod in apps:
         if isinstance(mod, tuple):
             mod, prefix = mod
-            urls.url_prefix = prefix
+            urls.url_prefix = prefix.strip().strip('/') or None
         app_name = '%s.%s' % (mod, 'views')
         __import__(app_name)
         urls.url_prefix = None
     
 def render_to_response(rq, fn, context=None, **response_kwargs):
     context = context or {}
-    rq.context.update(context)
-    return wsgi.Response(render_to_string(fn, rq.context), **response_kwargs)
+    for k, v in rq.context.iteritems():
+        if k not in context:
+            context[k] = v
+    return wsgi.Response(render_to_string(fn, context), **response_kwargs)
     
 from setuptools import setup
 
 PACKAGE = 'pysi'
-VERSION = '0.2.3'
+VERSION = '0.2.5'
 
 if __name__ == '__main__':
     # Compile the list of packages available, because distutils doesn't have