Thanks again for the clarification here.. I thought I would losing my mind for a moment. So, yes, it becomes obvious that controllers that are simply class attributes and behave as such, and controllers called as part of the a _lookup method are normally instantiated objects that are created and destroyed as appropriate to the request (per _lookup logic). I probably shouldn't have piled my inquiry onto this thread; sorry to confuse the two issues.
proceeding with clarity, john On Mar 19, 8:27 am, "Diez B. Roggisch" <[email protected]> wrote: > Am 19.03.2010 um 15:51 schrieb John Lorance: > > > > > > > Thanks Diez. After a re-read of this thread, I am understanding > > this more clearlt... just a weird situation to understand. > > Additionally, if I look at the sample code: > > > class BlogController(BaseController): > > > �...@expose() > > def _lookup(self, year, month, day, id, *remainder): > > dt = date(int(year), int(month), int(day)) > > blog_entry = BlogEntryController(dt, int(id)) > > return blog_entry, remainder > > > class BlogEntryController(object): > > > def __init__(self, dt, id): > > self.entry = model.BlogEntry.get_by(date=dt, id=id) > > > �...@expose(...) > > def index(self): > > ... > > �...@expose(...) > > def edit(self): > > ... > > > �...@expose() > > def update(self): > > > There is an implication that BlogEntryController gets its own > > instantiation on a per-request basis; but BlogController is only > > instantiated once; unless I'm totally reading this wrong in the > > doc. Sorry I seem a little dense here; just trying not to make a > > fatal mistake. > > That's a different thing, yes. Maybe I was the dense here - but the OP > asked (IMHO) for the "normal" controller hierarchy & it's objects, > which (with the exception of the root) aren't instantiated after > initial load. Simply because they are *class*-attirbutes. > > The above is a specialized thing: through _lookup, you do in fact > instantiate subobjects per request, but these aren't part of the > controller hierarchy, they just exist to dispatch further until there > is no path-components. But that's for something like REST. > > Diez -- 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.

