In any model you can do def myfuntion(): pass myfunction()
models are always executed before page loads, they are executed in alphabetical order. On Wednesday, 28 August 2013 02:16:04 UTC-5, Tobias Dahlberg wrote: > > Hi > > I have been developing some applications using Ruby on Rails but have now > switched to web2py. The switch have been very pleasant, I find web2py to be > really useful and fun to develop in. I have figured out how to do most > things that I am used to do in RoR. One thing I haven't been able to do yet > is to create a function that ALWAYS is called before page load. In RoR I > could create a function in ApplicationController and use a before_filter to > make sure the function always was called before every page was loaded. > > Is there a way to ALWAYS call a function before page load? > > I guess I could create a decorator and explicitly add it before all other > functions. Is that the best way to do it? If so, how do I create a > decorator? > > Thanks! > > BR > Tobias Dahlberg > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.