thank you for pyramid.events.BeforeRender

36 views
Skip to first unread message

Jonathan Vanasco

unread,
Jan 17, 2013, 7:37:51 PM1/17/13
to pylons-...@googlegroups.com
i was going crazy trying to figure out how to standardize a cache priming function for my templates.  this should do the trick.

thank you!

Mike Orr

unread,
Jan 17, 2013, 11:43:44 PM1/17/13
to pylons-...@googlegroups.com
Another idea I accidentally came up with is to put utility methods in
the base view class, which you can call as 'view.foo()'. It's neater
than making an API object in BeforeRender, and it also allows views to
call the exact same code if they need to sometimes.
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/jNu60L0WPVAJ.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.



--
Mike Orr <slugg...@gmail.com>

Jonathan Vanasco

unread,
Jan 18, 2013, 11:03:20 AM1/18/13
to pylons-discuss


On Jan 17, 11:43 pm, Mike Orr <sluggos...@gmail.com> wrote:
> Another idea I accidentally came up with is to put utility methods in
> the base view class, which you can call as 'view.foo()'. It's neater
> than making an API object in BeforeRender, and it also allows views to
> call the exact same code if they need to sometimes.

That's a good idea.

Can the View class's instance be accessed in the events ? It would be
nice to use both.
Reply all
Reply to author
Forward
0 new messages