On Jan 30, 10:24 am, Marco Mariani <[EMAIL PROTECTED]> wrote:
> Daniel Fetchinson wrote:
> > I haven't looked at your code yet but have to say that I also don't
> > like very much the fact that I have to define what widgets are used in
> > the controller. It feels more natural to declare this in the template.
> > I don't claim to have a very precise opinion on what solution would be
> > the best but it just doesn't feel right how things are now (and
> > probably will be with TW) although I go with the flow and do it the TG
> > way anyway because it's not a really big deal.
>
> To those looking for another point of view on widget matters, I suggest
> looking at how Zope3 implements the MVC pattern.
> Views and Adapters (*) are, IMHO, a natural way to express presentation
> and editing of objects inside and outside the web interface -- in
> particular WRT reuse.
> I had a crush with Z3 before trying TG (*), and I miss the flexibility
> offered by that approach.

I might need to use Zope (Plone) in the near future so I'll probably
absorb some new ideas. That description sounds similar to TGW/TW in
the sense that input widgets are in a sense adapters: they take a
model object and adapt it to a gui and take the gui input and adapt it
back to a model object. Probably much less flexible though since they
don't provide all the adaptation machinery Zope has...

> In there, the template receives a 'view' object that is the form
> instance. Instance which is thrown away at the end of the request, btw.

The fact TG/TW widgets being long-lived singletons is something that
has bugged me for some time... it does complicate much some things,
eg, disabling fields on a per request basis, being unable to store
state in order to remain thread-safe, etc... The reason for them being
this way was to be able to use the same instance to show a form and
validate the input on a subsequent request. However, there's probably
a better way to achieve this... Maybe TW2 gets rid of this long-lived
widget instance paradigm (although they'll probably be something else
if they do)

Alberto
--~--~---------~--~----~------------~-------~--~----~
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