Hi,

~flow wrote:
> i have been writing and testing my new web application with werkzeug, 
> and have grown quite fond of it. everything more or less just works, 
> and the entire application is still tiny, not overstructured, and fast.
> so, a big THANK YOU goes to the developers of werkzeug!
Thanks :)

> i still have a small problem with routing: with some routing setups, as
> in the example below, the browser will complain that the page isn't 
> redirecting properly. the source of the trouble seems to be that 
> `defaults` dictionary in the second rule. granted it is not needed at 
> this point in this particular setup, but what i really want is to map 
> routes like `/flimsy`, `/flimsy/any-query`, and `/flimsy/any-query/any-
>  options`. when the `options` part is absent, it should be given a 
> default, but as soon as i add that argument in the second routing rule,
> i get endless redirections. any ideas?
That could be a bug.  I'll try to

I tried to reproduce the example you've given from the shell, and I can't 
spot a problem here:

 >>> from werkzeug.routing import Map, Rule
 >>> map = Map([
...     Rule('/flimsy', defaults={'q': 'NIL'}),
...     Rule('/flimsy/<q>'),
...     Rule('/flimsy/<q>/<path:options>')
... ], strict_slashes=False)
 >>> adapter = map.bind('http://www.example.com/')
 >>> adapter.match("/flimsy")
(None, {'q': 'NIL'})
 >>> adapter.match("/flimsy/blah")
(None, {'q': u'blah'})
 >>> adapter.match("/flimsy/blah/blah")
(None, {'q': u'blah', 'options': u'blah'})
 >>> adapter.match("/flimsy/blah/blaz")
(None, {'q': u'blah', 'options': u'blaz'})

What version of Werkzeug are you using?


Regards,
Armin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" 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/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to