Jorge Godoy schrieb:
> Em Wednesday 06 February 2008 17:39:51 Kevin Horn escreveu:
>> I think having it as a seperate widget is fine, since one is a
>> CompundWidget and the other isn't. Even with changing the behavior based
>> on an attribute, you would likely have to make other changes in your code
>> in order to switch between them.
>
> But just on the widget.
>
> If the name changes then one has to update controllers and validators as
> well.
> In each and every controller where you use the widget value.
Probably ther is some misunderstanding.
Let's use a concrete example.
Assume you have something like the following:
class EmailFormSchema(validators.Schema):
name = validators.UnicodeString(...)
email = validators.Email(...)
class EmailFormFields(widgets.WidgetsList):
name = widgets.TextField(...)
email = widgets.TextField(...)
email_form = widgets.TableForm(
fields=EmailFormFields(),
validator=EmailFormSchema())
You cannot simply replace TextField with the current AutoCompleteField
in the code above, because it requires a different validator and
different handling of the values in your controller code. But you could
simply rename TextField to the newly suggested AutoCompleteTextfield,
add the search_controller in the parameters, and everything would work
like before, without any other modifications.
-- Christoph
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---