Hi all:
I want to have the inbox messages number associated with a user always
available.
What's the best way to do this?. As I can read in documentation, I can
accomplish this with:
- adding a property to the request with 'set_request_property', like:
myconf.set_request_property(calcula
On 07/02/2012 11:13 AM, Antonio Beamud Montero wrote:
Hi all:
I want to have the inbox messages number associated with a user always
available.
What's the best way to do this?. As I can read in documentation, I can
accomplish this with:
- adding a property to the request with 'set_request_proper
> - adding a property to the request with 'set_request_property', like:
> myconf.set_request_property(calculate_user_inbox, 'inbox')
>
> - Using an event suscriber:
> myconf.add_subscriber('myapp.calculate_user_inbox_suscriber',
> 'pyramid.events.NewRequest')
El 02/07/12 17:17, Chris McDonough escribió:
On 07/02/2012 11:13 AM, Antonio Beamud Montero wrote:
Hi all:
I want to have the inbox messages number associated with a user always
available.
What's the best way to do this?. As I can read in documentation, I can
accomplish this with:
- adding a pr
Well when you say "always available", are you *sure*? Do you want it
available when serving static resources? If you create a request
property then it is lazily calculated when you actually do request it
and with reify=True it will cache the result for the request duration.
NewRequest subscribers a