> What version of Werkzeug are you using?
used to be 0.2, now replaced by the present version obtained with hg
clone http://dev.pocoo.org/hg/werkzeug-main. surprise: the code works
now as advertised! so that seems to be a thing of the past. as an
aside, when i compare
@expose( '/flimsy', defaults = { q: 'empty', 'options':
'empty', } )
@expose( '/flimsy/<q>', defaults = { 'options':
'empty', } )
@expose( '/flimsy/<q>/<path:options>')
def flimsy( request, q, options ):
return Json_Response({ 'q': q, 'options': options, })
to
@expose( '/flimsy' )
@expose( '/flimsy/<q>' )
@expose( '/flimsy/<q>/<path:options>' )
def flimsy( request, q = 'empty', options = 'empty' ):
return Json_Response({ 'q': q, 'options': options, })
i realize that the second version (1) even worked with werkzeug 0.2,
(2) is much DRYer and easier to read, so i'll make that my preferred
pattern to write such routes. i guess there may be use cases where it
is preferrable to have default values defined right in the routes, but
this doesn't terribly look like one.
cheers & ~flow
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---