Depending on the purpose of the data you might want to store it inside
tg.request or tg.tmpl_context
Usually things which need to go to the template like paginators and so on
are stored on tg.tmpl_context while things that are related to request
satisfaction go into tg.request

At least that is my approach, I tend to consider tg.app_globals mostly
read-only after the bootstrap phase, so never store anything there during
request processing.


On Thu, Aug 8, 2013 at 4:45 PM, Remi Jolin <[email protected]> wrote:

> Hello,
>
> I'm trying to port to TG2 a statistic decorator I have with TG1.
>
> Mainly, this decorator gathers (parameters + timestamp) data before
> calling the actual method and use this data + new timestamp when the method
> returns. It then store this information in a DB.
>
> I tried to define it as a class with 2 hooks : one added to the
> before_validate list and the other in the after render list.
> But in the after_render hook, I need to get some information that was
> available when the before_validate hook is called.
> What is the best way to do that ? Putting the data in request['my_data'] ??
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> turbogears+unsubscribe@**googlegroups.com<turbogears%[email protected]>
> .
> To post to this group, send email to [email protected].
> Visit this group at 
> http://groups.google.com/**group/turbogears<http://groups.google.com/group/turbogears>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to