X-Git-Url: https://git.llucax.com/software/sercom.git/blobdiff_plain/134cb2d61093217000ace564978667f5a4828c5a..e9571fa510c7719a5b3e59a795fe8b7625112f3d:/sercom/subcontrollers/enunciado/__init__.py diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index 31a4c30..7f5661f 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -54,15 +54,15 @@ def get_options(): return [(0, _(u'--'))] + [(fk.id, fk.shortrepr()) for fk in fkcls.select()] class EnunciadoForm(W.TableForm): - fields = [ - W.TextField(name='nombre', label=_(u'Nombre'), + class Fields(W.WidgetsList): + nombre = W.TextField(label=_(u'Nombre'), help_text=_(u'Requerido y único.'), validator=V.UnicodeString(min=5, max=60, strip=True)), - W.SingleSelectField(name=fkname+'ID', label=_(fkname.capitalize()), + fk = W.SingleSelectField(name=fkname+'ID', label=_(fkname.capitalize()), options=get_options, validator=V.Int(not_empty=False)), - W.TextField(name='descripcion', label=_(u'Descripción'), + descripcion = W.TextField(label=_(u'Descripción'), validator=V.UnicodeString(not_empty=False, max=255, strip=True)), - ] + fields = Fields() javascript = [W.JSSource("MochiKit.DOM.focusOnLoad('form_nombre');")] form = EnunciadoForm()