what about reusing SQLAlchemy queries? do you put them as class methods in domain classes, repositories/daos, controllers?
On Wed, Jul 2, 2008 at 7:10 PM, Mike Orr <[EMAIL PROTECTED]> wrote: > > On Wed, Jul 2, 2008 at 2:38 PM, johnnyice <[EMAIL PROTECTED]> wrote: > > > > I have code that accesses the model, but it shared by multiple > > controllers. In CakePHP this would be a component (small piece of > > code shared by controllers), but does that make sense in pylons? > > > > If so i could just do: > > > > from myappname.controllers.components import my_shared_code > > > > > > What have others done? > > There's no official place, but good choices would be the base > controller, a subclass of the base controller, or a 'lib' module. > > It partly depends on whether it has to access 'self' (in which case it > can't be a function), and whether it has to access > request/response/session/render (which some people may feel > uncomfortable putting in a function). > > -- > Mike Orr <[EMAIL PROTECTED]> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
