Neil Schemenauer wrote: > I don't see any advantage in attaching it to the publisher or request > object. For global shared objects we use a function, something like > "from myapp.database import get_dbconn". If you are sure your > application will never be multi-threaded you could just use a module > global. A function seems to be more flexible though. > I agree. > >>please note, these are off the cuff and may be stupid. Now I can sit >>and analyze them and conclude that the first one is probably the best >>way. or i could be wrong. it might not be a best practice in quixote. > > > The nice thing about Quixote is that questions like this are usually > questions about programming in Python rather than about using Quixote > (at least IMHO). > since i value YHO, that's a welcome change. frankly i'm tired of "well in python you do it this way; but in XXXX its not quite the same..." answers i have to give to colleagues. > >>but i wouldn't know simply because there isn't anything in place to >>facilitate communication. > > > Hmm, I thought the communication was flowing quite well. What's wrong > with quixote-users@mems-exchange.org? I think most Quixote experts hang > out here, the list is public and archived. I think you can even read it > from Gmane. > ah, sorry after rereading this what i really meant was accessible, searchable place. AFAIK, the mailing list is not searchable or is it? Possibly from Gmane? and err what's Gmane? nm, off to google...this mailing list seems helpful and has good discussions... well until i came along > >>now how about this scenario: I have a Department that has a list of >>Agencies. In some AgencyUI we need some information from Department. >>The url is myapp/department/1/agency/5/showSomeInfo. In Zope we'd use >>acquisition to call the right methods from the department to which the >>specific agency belongs (well actually in zope the above would be a pita >>to get right). To paraphrase Jim Fulton, "acquisition is cool, until it >>isn't". How do I handle it here? > > > I think I would do something like this: > > # myapp.department module > > class DepartmentUI: > def __init__(self, component): > self.department = get_department(component) # careful with input! > > def agency(self, request): > return AgencyUI(self.department, component) > > def _q_getname(request, component): > return DepartmentUI(component) > > class AgencyUI: > def __init__(self, department): > self.department = department > self.agency = None > > def _q_getname(self, request, component): > self.agency = get_agency(self.department, component) > return self # or something else > > def showSomeInfo(self, request): > ... > > That's a little rough but hopefully enough to give you the idea. The > key idea is that DepartmentUI passes the department object to AgencyUI. well i'm really glad i started this thread. i don't think i would have thought of wrapping the classes in UI classes. makes a heck of alot of sense along with reusable classes with a minimum of "quixote specifics". > > I realized that. My response was a subtle attempt to indicate that > quixote-users is a pretty good place to discuss using Quixote. Having a subtlety, heh... my wife has discovered that anything less subtle than a 2x4 won't penetrate my skull. > community supported site would be cool but I suspect the community is > not large enough yet to support one. > keyword "yet". thanks for the time. and the code -- Tom Jenkins Development InfoStructure http://www.devis.com