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_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') - Using the beaker session. What's the pros and the cons?
You haven't described what's wrong with just calling "calculate_user_inbox" from view code without involving any of the above things. I doubt there can be any reasonable discussion of pros and cons without understanding why you're trying to involve framework machinery in the first place.
- C -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
