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
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
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
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
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
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.
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
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