Jorge Godoy schrieb:
> It would be more interesting if this change was based on another attribute or
> something like that... Having it on the name of the widget might require too
> many changes on the code.
>
> What about, for example, some "auto=True" attribute instead?
You mean, as an attribute to the default TextField? But that would blow
up the TextField too much, and we need to keep the old AutoCompleteField
for compatibility anyway. And I think it's even easier and clearer to
replace "TextField" with "AutoCompleteTextField".
To avoid duplication, we could define the classes this way:
class AutoComplete(Widget):
"""Mixin class"""
javascript = ...
css = ...
params = ["search_controller", "show_spinner", ...]
...
class AutoCompleteTextField(TextField, AutoComplete):
"This is the same auto complete widget as before."""
template = ...
AutoCompleteField(CompoundFormField, AutoComplete):
"""TextField with auto complete functionality."""
template = ...
member_widgets = ["text_field", "hidden_field"]
text_field = TextField(name="text")
hidden_field = HiddenField(name="hidden")
In the widget browser, the AutoCompleteField should do something that
requires its additional functionality, so you understand why there are
these two different flavors.
-- Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---