I tried the parametric router and it works super-fine! I wasn't using it because at the very beginning I found the pattern-based method more powerful.
Thank you very much for your help Jonathan! I wish you a good Tuesday! ;) Cheers, David On 22 October 2012 18:55, Jonathan Lundell <[email protected]> wrote: > On 22 Oct 2012, at 9:28 AM, David Sorrentino <[email protected]> > wrote: > > I have got some doubts about the use of anchor links and the URL > rewriting by means of routes.py. > > > > This is my routes.py: > > > > routes_out = ( > > ('/myapp/default/$f', '/$f') > > ) > > > > So /myapp/default/just_a_page is rewritten in output like /just_a_page . > This works. > > > > The problem raises when I specify an anchor link in my view, for > instance: > > {{=URL(f='just_a_page', anchor="just_an_anchor")}} > > > > Indeed in this case routes.py does not rewrite the URL, since > /myapp/default/just_a_page#just_an_anchor does not match > with/myapp/default/$f (understandably). > > > > So, how could I set up routes.py so that it will rewrite URLs containing > anchors? > > > > Thank you in advance for your help. > > Can you use the parametric router? It should handle anchors properly. > > Alternatively, try something like: > > routes_out = ( > ('/myapp/default/$f', '/$f') > ('/myapp/default/$f/$anything', '/$f/$anything') > ) > > > -- > > > > --

