>From what I've read in the documentation widgets are intended to be
stateless and instantiated once for all controllers.  I usually pass
the widget a 'values' variable which is a dict containing anything the
template needs to display correctly.  I started out passing all my
display data to the init function and then copying it to self.foo, but
I don't think that's really a good practice.

On May 6, 6:00 pm, iain duncan <[EMAIL PROTECTED]> wrote:
> On Sat, 2007-05-05 at 22:14 -0700, kerinin wrote:
> > I turned on CherryPy's profiling and took a look at the results.  I'm
> > not really sure what I'm looking at though.  From what I can tell the
> > majority of the time is spent on the database, but it may just be that
> > the database.py module calls a lot of other functions.
>
> One thing I've noticed myself is that it's really easy with SO or SA to
> write code that is easy to write but hits the db a greater number of
> times than is necessary. ( IE using Ormthing.get() all over the place in
> multiple functions instead of getting the results once and passing them
> around ). I know *I* need to weed out the spots where I'm doing that!
>
> Iain


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to