[pylons-discuss] Pyramid and namespaces

2014-10-15 Thread Thierry Florac
Hi, Always on the road to adapting a Zope 3 application to Pyramid... Another of my problems is that Zope3 is handling namespace traversers; for example, you can use URLs like /++skin++MySkin/..., /++etc++site/..., or anything else by defining custom namespaces. In my use case, the goal of such

Re: [pylons-discuss] Pyramid and namespaces

2014-10-15 Thread Chris McDonough
On 10/15/2014 08:35 AM, Thierry Florac wrote: Hi, Always on the road to adapting a Zope 3 application to Pyramid... Another of my problems is that Zope3 is handling namespace traversers; for example, you can use URLs like /++skin++MySkin/..., /++etc++site/..., or anything else by defining

[pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
i'm using url dispatch , and I have some routes that begin with this: /by/{username:\w+} i now need to support 'id' based urls as well. e.g. /by/{userid:\-\d+} the regexes are actually more complicated, and defined elsewhere. there is an approach i think I'd like to pursue, and

Re: [pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Michael Merickel
When defining a route, there are several hooks available to you to configure custom behaviors. 1) The route pattern. 2) Route predicates. 3) Route factory. You basically touched on all of these in your examples. It's usually advantageous to have a single route, so let's ignore the pattern

Re: [pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
Thanks! It looks like Route Factory is what I want. The docs are pretty sparse on it (at least on http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/urldispatch.html) I'll look up some examples in public Pyramid projects and blogs later. I didn't realize that I could affect the dict

Re: [pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Michael Merickel
Predicates should return True or False. They have no sense of locality, so if you mess with the request and return True, and another predicate returns False then you have screwed up the request for some subsequent route that may match. This is obviously not ideal, but will work in 95% of apps.

[pylons-discuss] Re: strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
wow. thanks. that is a much cleaner explanation than the docs. converting to a factory was ridiculously simple! -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from this group and stop receiving emails from it, send an email

[pylons-discuss] Re: Pyramid and namespaces

2014-10-15 Thread Laurence Rowe
On Wednesday, 15 October 2014 05:35:19 UTC-7, Thierry Florac wrote: Hi, Always on the road to adapting a Zope 3 application to Pyramid... Another of my problems is that Zope3 is handling namespace traversers; for example, you can use URLs like /++skin++MySkin/..., /++etc++site/..., or