On Mar 21, 1:54 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Well, if you'd put the above declarations _into_ the controller method, you > could do it - as python is scope-aware, and your fields and visibilities and > whatnot could easily be computed befor class-creation. After all, a class is > also just an object.
Yeah, I'm trying that aproach now. I had thought about this, but don't like the runtime performance hit of creating the widgets for each request. It does give the maximum flxibility at runtime though. I think I'll still persue the approach of statically creating the widget list, but somehow taking a copy of the widgets at runtime as a mutable set of widgets, it should be a fair bit faster then contstructing them each time. I think that most of the hit in constructing a widget is in the kid template compilation anyway. > Certainly :) I'm sorry if this sounds rude or harsh, it's certainly not meant > that way - but all you need is some mind-wrapping IMHO. I'v been doing a > mid-sized TG-project the pasts few months, and so far it beated the hell of > evrything else wrt to productivity. There are some quirks, and I admit that > programming with widgets is something that requires that you shouldn't be > afraid of looking into the code of turbogears. But so far, it solved all my > problems, and most of the time more on the elegant side of life. > No, not rude or harsh at all. I'd sooner someone tell be to stop being so damn stupid and/or tell me the bleedin obvious way to do it rather than not say anything at all. This is why I'm asking more TG experienced people like yourself for better ways of doing things :) I know I also must sound a bit stupid sometimes, but I'm just trying to explore all the possiblities and make the right choices early in the project. I think that most people would agree that the TG docs are not what they could be so the only real way to find some of this out is read the code, try things and ask people. I value your answers. Hopefully, when I find the "right" answer I will update the docs. I've done very large projects in ASP.NET, but this concept of one static class shared between threads just takes some mind bending. I'm still surprised that widgets (or more directly forms) work (or at least are recommended to be used) this way. It seems that many people are getting tripped up by this and each one has their own way of working around the same limitation. Kind of begs for a more general solution in the widgets architecture (by somewone cleverer than me for sure!). Thanks again for your feedback, Gary. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

