[Web-SIG] routing_args accepted - selector updated

Sylvain Hellegouarch sh at defuze.org
Wed Nov 8 08:32:03 CET 2006


Luke Arno wrote:
> I see that Ian has marked the proposed routing args
> convention as accepted. I have updated selector and
> now consider it a stable feature so feel free to use it.
> 
> http://wsgi.org/wsgi/Specifications/routing_args
> https://lukearno.com/projects/selector/
> 

Hello there,

Sorry for being so late into the discussion. I must say I like that
proposal and I completely sedond it. Except for one small point, the
spec says:

"The values in routing_args need not be strings (except for the keys of
named_args). For instance, a dispatcher is allowed to parse
/archive/2005/10/01 into ((), {'date': datetime.date(2005, 10, 1)})."

This could be an issue for deployment if we consider that applications
or other middleware will not be able to know what a middleware that
implements this proposal has decided to do, map the values or not.

Say I have the value '00001' in my URI, I don't want the dispatcher to
assume it's an int and maps it to '1'. Maybe this value is an identifier
for me and I need the complete value. There is a loss of information.

What I would like to add to the proposal if it's not too late is the
mean to tell the middleware whether or not I agree that it maps values
automatically.

Say:

s = Selector(allow_mapping=False)

Or something equivlent.

Personally I would in fact disable that feature altogether and let the
application decide what is best but I doubt you will appreciate that idea.

In any case I will certainly use this proposal in the WSGI dispatcher of
Amplee, my APP implementation.

 http://trac.defuze.org/browser/oss/amplee/amplee/handler/store/wsgi/__init__.py

Thanks,
- Sylvain



More information about the Web-SIG mailing list