On Sun, Oct 24, 2010 at 2:18 PM, Luther Goh Lu Feng <elf...@yahoo.com> wrote: > If I have a function that I intend to call from different controllers, but I > have no need for the function to have a view, where should this function be > defined? eg. a function that simply calculates the outcome of a math formula, > and several controllers will call this function to display the result. > > Should it be defined within a controller, or elsewhere?
It's a helper function, so I guess it's best if it lived in a separate module, and you can then import it from the module. If I'm not mistaken, anything defined in ``db.py`` will also become globally accessible, so that's another place where you can define it. -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny Gimp Brushmakers Guild http://bit.ly/gbg-group