Hi, On Thu, May 08, 2014 at 01:22:13PM -0700, Achim Domma wrote: > Hi, > > I have the following two routes in my application: > > /{base_id}/{sub_id}/{some_text} > /{base_id}/{sub_id} > > Obviously I assume that none of these parts contains a slash, which has > just proven to be wrong. ;-) I have control over some_text, so I can make > sure, that it will not contain a slash, but I have to accept slashes in > sub_id. I tried to encode them as %2F, but I found out that those are > decode before reaching Pyramid. My last resort would be a "greedy" pattern > for sub_id, so some_text should contain the value after the last slash and > sub_id everything between the second and the last slash. I know that this > does not work with the default url matching and that it would be a hack, > but is there some way to do that with pyramid? I would be happy to accept > more or less every not too intrusive hack.
I don't think you can have a slash in sub_id but you don't need a «hack» to do what you want: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/hybrid.html#using-subpath-in-a-route-pattern > > cheers, > Achim > > -- > 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 to pylons-discuss+unsubscr...@googlegroups.com. > To post to this group, send email to pylons-discuss@googlegroups.com. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. -- 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 to pylons-discuss+unsubscr...@googlegroups.com. To post to this group, send email to pylons-discuss@googlegroups.com. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.