following the info here:

I tried to use:

vars = self.parse_variables(environ)

and I got:

AttributeError: 'tuple' object has no attribute 'get'

to fix this I attached a small patch that makes sure a dict is return
instead of a tuple to the offending line.

Unfortunately from what I can see I don't have the the elements on my url:

same example as before:


with a controller like this:

class RootController(BaseController):
    def editmethod(self, slug):

this works in TG2 without routes and the editmethod will get the post
slug as a positional parameter thanks to object dispatch. But If I
protect it with the @require decorator, the result of:

vars = self.parse_variables(environ)

in the said decorator contains only empty variables for all the
variables. Which seem logical since there is no post/get vars in my

The solution I proposed a few days ago was to have a possibility for
the TG2 object dispatcher to call the check_auth with the parameters
(python params) that are computed by object dispatch. This is the only
way my predicate will ever know that post-slug is an actual argument
to my actual controller without fiddling in the url by itself...

Index: repoze/what/
--- repoze/what/   (révision 3584)
+++ repoze/what/   (copie de travail)
@@ -313,7 +313,7 @@
             post_vars = parse_formvars(environ, False) or {}
         except KeyError:
             post_vars = {}
-        routing_args = environ.get('wsgiorg.routing_args', {})
+        routing_args = environ.get('wsgiorg.routing_args', (None, {}))[1]
         positional_args = routing_args.get('positional_args') or ()
         named_args = routing_args.get('named_args') or {}
         variables = {

Repoze-dev mailing list

Reply via email to