I use yapps to generate a parser for a LaTex-ish language (for example to translate stuff like \begin{itemize}
to the corresponding <ul>
-Tags) within pyramid. One command (i.e. \ref{SOMEID}
) should construct a route via a call of route_url
(or route_path
) and pass the id to it. Since this call happens deep in the code that was generated by yapps and the grammar that I defined, I don't see any possibility to pass a request object to it.
Is there some sort of global request object? Or, since I foresee that I shouldn't use it, is there a possibility to construct a route (that depends on a parameter) without a request object?
get_current_registry()
frompyramid.threadlocal
to get the registry and then could just callroute_path
. – Trolly