You can define classes on models or controllers, the only caveat is that you can never import that classes in to other modules.
They will be defined and will be available for the current request on global environment (means that it will be available on the flow of models->called-controller->rendered view) I never had any problem using classes on models or controllers. On Mon, Aug 20, 2012 at 3:41 PM, Yarin <[email protected]> wrote: > > In this > post<https://groups.google.com/forum/#!topic/web2py/dmN54cpMuXo%5B1-25%5D> > Massimo > says: > > "One should not define classes in Models and Controllers. I have issued > that warning already to our users..." > > On the other hand, in this > post<https://groups.google.com/d/msg/web2py/Q1sf7DA5BL4/L4pkg-GMuzUJ> and > again here<https://groups.google.com/d/msg/web2py/j-_P7nkn_OY/e1TJGksh3XAJ> > Anthony > says: > > "You can define classes in models" > > So I'm looking for some clarification. I can't seem to find anything on > this in docs. Can someone point me to where this is discussed in the book, > or explain further? > > Is the rule: classes may *only* be defined in *modules*, or is it more > complicated than that? > > -- > > > > --

