class OrderForm(formbase.AddRecordForm):
..etc..
hover_help = True
#__widget_args__ = {'hover_help' : True} #nope, causes exception
__base_widget_args__ = {'hover_help' : True}
reqAmount = TextField('reqAmount',validator=IntValidator(required=True,min=1),size=15, help_text='Please enter quantity of items you want to buy or sell.')
Later, I want to use more fancy tooltips, then how do I set the underlying tw2 widget template?
Juraj
class OrderForm(formbase.AddRecordForm):
class mytableform(tw2.forms.TableForm):
class mytablelayout(tw2.forms.TableLayout):
#table_layout.html or table_layout.mak copied from TW2 and customized
template = 'myproject.templates.table_layout'
child = mytablelayout
#tell sprox to use mytableform instead
__base_widget_type__ = mytableform
#sprox business as usual
__model__=Order
One caveat: when using Turbogears, I found that the table_layout template is not reloaded when app is reloaded.
Juraj
Tried to fix formatting:
class OrderForm(formbase.AddRecordForm):
class mytableform(tw2.forms.TableForm):
class mytablelayout(tw2.forms.TableLayout):
#table_layout.html or table_layout.mak copied from TW2 and customized
template = 'myproject.templates.table_layout'
child = mytablelayout
#tell sprox to use mytableform instead
__base_widget_type__ = mytableform
#sprox business as usual
__model__=Order