mario henrique schrieb:
> but this doesn't work in class widgets.Labe().
> [...]
> I think that a solution would be to patch widgets/forms.py .
Another way to have custom labels for form fields is to set the 'label'
argument for the form field widget to an ElementTree.Element rather than a
string (or a list of those or both).
Example:
helplink = ET.Element('a', href='/static/help.html',
onclick='return open_helpwin(this.href);')
helplink.text = _(u'Help')
class CommentFormFields(WidgetsList):
text = TextArea('text', label=[_('Text '), helplink], rows=10, cols=40)
...
Rather cumbersome, but it works because the ListForm/TableForm templates just
have
<label class="fieldlabel" for="${field.field_id}" py:content="field.label" />
in their templates.
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
-~----------~----~----~----~------~----~------~--~---