On Mar 21, 10:39 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> Gary Doades <[EMAIL PROTECTED]> writes:
> > I can't believe that this is not often needed for most real world
> > applications. What do other people do in this situation?
>
> Custom widgets?
>
> > It would be very nice if something similar were available in TG or at
> > least in ToscaWidgets before TG 2.0 is done.
>
> You can achieve that with a custom widget today.
>

Oh, OK, it looks like I will have to create custom widgets for pretty
much all of them then. I think I'll have a look at the whole widgets
framework and try to find the best place to put this functionality in
generically.

Thanks for the advice..

BTW I just had a peek at the Django newforms widgets (fields). It
seems they had a similar problem. It looks like it was solved by
creating the form definition statically (like TG) but at runtime the
user creates an instance of the form. At instance construction the
form copies its class field attributes into instance fields attributes
(self.fields) so that they can be modified at runtime without
affecting any other form instance. This seems to work for statically
declaring the form but is efficient and flexible at runtime as the
form "definition" (the list of widgets etc.) is copied to a mutable
instance.

The TG widgets are somewhat more complex than the Django ones, but I
might take a look at this.

Thanks,
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to