Hi,

I use the PrefixMiddleware and usually url_for generates good urls for me:
>>> h.url_for('/documents', action='foo')
'/bar/documents?action=foo'

however when the controller parameter is present, it doesn't:
>>> h.url_for(controller='/documents', action='foo')
'/documents/foo'

The docs [1] say:
> The following rules are used to determine when and how to keep the
> current requests parameters:
>   * If the controller is present and begins with ‘/’, no defaults are
>     used
>   * If the controller is changed, action is set to ‘index’ unless
>     otherwise specified

I don't know what 'no defaults are used' means, but also 'documents' returns the same result:
>>> h.url_for(controller='documents', action='foo')
'/documents/foo'

Is that a bug or just the expected behavior? In the latter case, can you explain to me why it behaves like this? And how I could have figured out that myself?

fs

[1] http://pylonshq.com/docs/en/0.9.7/thirdparty/routes/#module-routes.util

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

Reply via email to