def __init__(self, *args, **kwargs): """Initialize the widget. If no validator is specified at instantiation time, instantiates the default validator. """ tw_TA.__init__(self, *args, **kwargs) if 'validator' not in kwargs: self.validator = self.validator()
class RolForm(TableForm): hover_help = True show_errors = True tipo_options = ['Sistema', 'Proyecto'] fields = [ HiddenField('id_rol', label_text='Id', help_text='Id del Rol'), SingleSelectField('tipo', validator=NotEmpty, options=tipo_options, label_text='Tipo', help_text='Seleccione el tipo de rol'), Spacer(), TextField('nombre_rol', validator=NotEmpty_PlainText, label_text='Nombre', size=38, help_text='Introduzca el nombre del Rol.'), Spacer(), TextArea('descripcion', label_text='Descripcion', attrs=dict(rows=10, cols=50), help_text='Introduzca una descripcion del Rol'), Spacer() ] submit_text = 'Guardar Rol'
class AtributoForm(TableForm): hover_help = True show_errors = True genre_options = ['Texto', 'Numerico', 'Fecha'] fields = [ HiddenField('id_atributo', label_text='Id', help_text='Id del atributo'), HiddenField( 'id_tipo_item', validator=NotEmpty, label_text='Identificador del Tipo de Item', help_text='Introduzca el tipo de item asociado al atributo'), Spacer(), TextField('nombre', validator=NotEmpty, label_text='Nombre', size=38, help_text='Introduzca el nombre del atributo'), Spacer(), TextArea('descripcion', attrs=dict(rows=10, cols=50), label_text='Descripcion'), Spacer(), SingleSelectField('tipo', options=genre_options, label_text='Tipo', help_text='Seleccione el tipo del atributo.') ] submit_text = 'Guardar Atributo'
class MovieForm(TableForm): template = "toscasample.widgets.templates.table_form" css = [CSSLink(link=url('/css/tooltips.css'))] genre_options = enumerate(( 'Action & Adventure', 'Animation', 'Comedy', 'Documentary', 'Drama', 'Sci-Fi & Fantasy')) fields = [ TextField('title', label_text='Movie Title', help_text='Please enter the full title of the movie.'), Spacer(), TextField('year', size=4, help_text='Please enter the year this movie was made.'), CalendarDatePicker('release_date', date_format='%y-%m-%d', help_text='Please pick the exact release date.'), SingleSelectField('genre', options=genre_options, help_text = 'Please choose the genre of the movie.'), Spacer(), TextArea('description', attrs=dict(rows=3, cols=25), help_text = 'Please provide a short description of the plot.'), Spacer()] submit_text = 'Save Movie'
class MovieForm(TableForm): hover_help = True genre_options = [ x for x in enumerate(('Action & Adventure', 'Animation', 'Comedy', 'Documentary', 'Drama', 'Sci-Fi & Fantasy')) ] fields = [ TextField('title', label_text='Movie Title', help_text='Please enter the full title of the movie.'), Spacer(), TextField('year', size=4, help_text='Please enter the year this movie was made.'), CalendarDatePicker('release_date', date_format='%y-%m-%d', help_text='Please pick the exact release date.'), SingleSelectField('genre', options=genre_options, help_text='Please choose the genre of the movie.'), Spacer(), TextArea('description', attrs=dict(rows=3, cols=25), help_text='Please provide a short description of the plot.'), Spacer() ] submit_text = 'Save Movie'
class LineaBaseForm(TableForm): hover_help = True show_errors = True fields = [ HiddenField('id_linea_base', label_text='Id', help_text='Id del usuario'), TextField('nombre', validator=NotEmpty, label_text='Nombre', help_text='Introduzca el nombre de la linea base'), Spacer(), TextArea('descripcion', label_text='Descripcion', help_text='Introduzca una descripcion de la linea base'), Spacer(), HiddenField('id_estado', validator=NotEmpty, label_text='Estado', help_text='Identificador del estado de la linea base.'), HiddenField('id_fase', validator=NotEmpty, label_text='Fase', help_text='Identificador de la fase.'), HiddenField('version', validator=NotEmpty, label_text='Version', help_text='Version de la linea base') ] submit_text = 'Guardar Linea Base'
class fields(WidgetsList): title = TextField() year = TextField() release_date = CalendarDatePicker() genre_options = enumerate(('Action & Adventure', 'Animation', 'Comedy', 'Documentary', 'Drama', 'Sci-Fi & Fantasy')) genre = SingleSelectField(options=genre_options) description = TextArea()
class fields(WidgetsList): came_from = HiddenField(validator=NotEmpty) associableid = HiddenField(validator=NotEmpty) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) email = TextField(label_text=l_('E-Mail'), size=TF_SIZE, validator=All(Email, NotEmpty)) text = TextArea(label_text=l_('Text'), rows=TA_ROWS, cols=TA_COLS)
class fields(WidgetsList): title = TextField(validator=NotEmpty) author = TextField(validator=NotEmpty) description = TextArea(attrs=dict(rows=3, cols=25)) date_taken = CalendarDatePicker(validator=DateConverter()) subject_list = ((1, "Philosophy"), (2, "Maths"), (3, "Literature"), (4, "History"), (5, "Politics"), (6, "Sociology")) subject = SingleSelectField(options=subject_list)
class fields(WidgetsList): categoryid = SingleSelectField(label_text=l_('Category'), size=SF_SIZE) languageid = SingleSelectField(label_text=l_('Language'), size=SF_SIZE) title = TextField(label_text=l_('Title'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(50))) text = TextArea(label_text=l_('Text'), rows=20, cols=TA_COLS) tagids = TextField(label_text=l_('Tags'), size=TF_SIZE, attrs=dict(title=l_('Comma separated list of tags')))
class fields(WidgetsList): uri = TextField(label_text='URI', size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) languageid = SingleSelectField(label_text=l_('Language'), size=SF_SIZE) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) description = TextArea(label_text=l_('Description'), rows=TA_ROWS, cols=TA_COLS) tagids = TextField(label_text=l_('Tags'), size=TF_SIZE, attrs=dict(title=l_('Comma separated list of tags')))
class fields(WidgetsList): _method = HiddenField(default='PUT', validator=None) categoryid = HiddenField(validator=NotEmpty) id_ = TextField(size=TF_SIZE, validator=None, disabled=True) languageid = CascadingSingleSelectField(label_text=l_('Language'), size=SF_SIZE, cascadeurl=tg.url('/category/translation'), extra=['categoryid']) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(50))) description = TextArea(label_text=l_('Description'), rows=TA_ROWS, cols=TA_COLS)
class fields(WidgetsList): _method = HiddenField(default='DELETE', validator=None) commentid = HiddenField(validator=NotEmpty) id_ = TextField(size=TF_SIZE, validator=None, disabled=True) date_ = TextField(label_text=l_('Date'), size=TF_SIZE, validator=None, disabled=True) to_ = TextField(label_text=l_('To'), size=TF_SIZE, validator=None, disabled=True) name_ = TextField(label_text=l_('Name'), size=TF_SIZE, validator=None, disabled=True) text_ = TextArea(label_text=l_('Text'), rows=TA_ROWS, cols=TA_COLS, validator=None, disabled=True)
class fields(WidgetsList): _method = HiddenField(default='PUT', validator=None) commentid = HiddenField(validator=NotEmpty) id_ = TextField(size=TF_SIZE, validator=None, disabled=True) date_ = TextField(label_text=l_('Date'), size=TF_SIZE, validator=None, disabled=True) to_ = TextField(label_text=l_('To'), size=TF_SIZE, validator=None, disabled=True) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) email = TextField(label_text=l_('E-Mail'), size=TF_SIZE, validator=All(Email, NotEmpty)) text = TextArea(label_text=l_('Text'), rows=TA_ROWS, cols=TA_COLS)
class fields(WidgetsList): _method = HiddenField(default='PUT', validator=None) pageid = HiddenField(validator=NotEmpty) id_ = TextField(size=TF_SIZE, validator=None, disabled=True) languageid = CascadingSingleSelectField(label_text=l_('Language'), size=SF_SIZE, cascadeurl=tg.url('/page/translation'), extra=['pageid']) version = CascadingSingleSelectField(label_text=l_('Version'), size=SF_SIZE, cascadeurl=tg.url('/page/version'), extra=['pageid', 'languageid']) modified = TextField(disabled=True, label_text=l_('Last Modified'), validator=None) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) text = TextArea(label_text=l_('Text'), rows=TA_ROWS, cols=TA_COLS)
class MovieForm(TableForm): genre_options = enumerate(('Action & Adventure', 'Animation', 'Comedy', 'Documentary', 'Drama', 'Sci-Fi & Fantasy')) fields = [ TextField('title', label_text='Movie Title'), Spacer(), TextField('year', size=4), CalendarDatePicker('release_date', date_format='%y-%m-%d'), SingleSelectField('genre', options=genre_options), Spacer(), Label(text='Please provide a short description of the plot:'), TextArea('description', attrs=dict(rows=3, cols=25)), Spacer() ] submit_text = 'Save Movie'
class fields(WidgetsList): _method = HiddenField(default='PUT', validator=None) linkid = HiddenField(validator=NotEmpty) id_ = TextField(size=TF_SIZE, validator=None, disabled=True) uri = TextField(label_text='URI', size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) languageid = CascadingSingleSelectField(label_text=l_('Language'), size=SF_SIZE, cascadeurl=tg.url('/link/translation'), extra=['linkid']) version = CascadingSingleSelectField(label_text=l_('Version'), size=SF_SIZE, cascadeurl=tg.url('/link/version'), extra=['linkid', 'languageid']) modified = TextField(disabled=True, label_text=l_('Last Modified'), validator=None) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) description = TextArea(label_text=l_('Description'), rows=TA_ROWS, cols=TA_COLS) tagids = TextField(label_text=l_('Tags'), size=TF_SIZE, attrs=dict(title=l_('Comma separated list of tags')))
class TipoItemForm(TableForm): hover_help = True show_errors = True fields = [ HiddenField('id_tipo_item', label_text='Id', help_text='Id del tipo_item'), HiddenField('id_fase', label_text='Id de Fase', help_text='Introduzca un id de fase'), TextField('nombre', validator=NotEmpty, label_text='Nombre', size=38, help_text='Introduzca el nombre del Tipo de Item correcto'), Spacer(), TextField('codigo', validator=NotEmpty, label_text='Codigo', size=38, help_text='Introduzca el codigo del Tipo de Item correcto'), Spacer(), TextArea('descripcion', attrs=dict(rows=10, cols=50), label_text='Descripcion'), Spacer()] submit_text = 'Guardar'
class PermisoForm(TableForm): hover_help = True show_errors = True fields = [ HiddenField('id_permiso', label_text='Id', help_text='Id del Permiso'), TextField('nombre_permiso', validator=NotEmpty, label_text='Nombre', size=38, help_text='Introduzca el nombre del Permiso.'), Spacer(), TextArea('descripcion', label_text='Descripcion', attrs=dict(rows=10, cols=50), help_text='Introduzca una descripcion del Permiso'), Spacer() ] submit_text = 'Guardar Permiso'
class fields(WidgetsList): mediatype = HidingSingleSelectField(label_text=l_('Type'), size=SF_SIZE, options=[''] + media_types, mapping={'image': ['uploadfile'], 'video': ['uploadfile', 'fallbackfile'], 'youtube': ['uri'], 'vimeo': ['uri'], }, validator=All(NotEmpty, OneOf(media_types)), ) uri = TextField(label_text='URI', size=TF_SIZE, validator=All(UnicodeString, MaxLength(255))) uploadfile = FileField(label_text=l_('File to upload')) fallbackfile = FileField(label_text=l_('Fallback file')) languageid = SingleSelectField(label_text=l_('Language'), size=SF_SIZE) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) description = TextArea(label_text=l_('Description'), rows=TA_ROWS, cols=TA_COLS) tagids = TextField(label_text=l_('Tags'), size=TF_SIZE, attrs=dict(title=l_('Comma separated list of tags')))
class MovieForm(TableForm): template = "toscasample.widgets.templates.table_form" css = [CSSLink(link=url('/css/tooltips.css'))] show_errors = True genre_options = [ x for x in enumerate(('Action & Adventure', 'Animation', 'Comedy', 'Documentary', 'Drama', 'Sci-Fi & Fantasy')) ] fields = [ TextField('title', validator=NotEmpty, label_text='Movie Title', help_text='Please enter the full title of the movie.'), Spacer(), TextField('year', validator=Int(min=1900, max=2100), size=4, help_text='Please enter the year this movie was made.'), CalendarDatePicker('release_date', validator=DateConverter(), help_text='Please pick the exact release date.'), SingleSelectField('genre', options=genre_options, help_text='Please choose the genre of the movie.'), Spacer(), TextArea('description', attrs=dict(rows=3, cols=25), help_text='Please provide a short description of the plot.'), Spacer(), FileField('picture_filename', help_text='Please provide a picture for this movie.'), Spacer() ] submit_text = 'Save Movie'
class ProyectoForm(TableForm): hover_help = True show_errors = True fields = [ HiddenField('id_proyecto', label_text='Id', help_text='Id del Proyecto'), HiddenField('id_usuario', label_text='id_usuario', help_text='Id del Usuario.'), Spacer(), TextField('nombre', validator=NotEmpty, label_text='Nombre', size=38, help_text='Introduzca su Nombre completo.'), Spacer(), TextArea('descripcion', label_text='Descripcion', attrs=dict(rows=10, cols=50), help_text='Introduzca una descripcion del Proyecto'), Spacer(), CalendarDatePicker('fecha', date_format='%d/%m/%Y', help_text='Seleccione la fecha de Creacion del Proyecto'), Spacer(), CheckBox('iniciado', disabled='False', label_text='Iniciado', help_text='Indica si el proyecto se ha iniciado')] submit_text = 'Guardar Proyecto'
def display(self, value=None, **kwargs): if value: value = line_break_xhtml(value) return TextArea.display(self, value, **kwargs)
class fields(WidgetsList): articleid = HiddenField(validator=All(UnicodeString, NotEmpty)) languageid = SingleSelectField(label_text=l_('Language'), size=SF_SIZE) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(255))) text = TextArea(label_text=l_('Text'), rows=TA_ROWS, cols=TA_COLS)
class fields(WidgetsList): title = TextField() year = TextField(size=4, default=1984) description = TextArea()
class fields(WidgetsList): languageid = SingleSelectField(label_text=l_('Language'), size=SF_SIZE) name = TextField(label_text=l_('Name'), size=TF_SIZE, validator=All(UnicodeString, NotEmpty, MaxLength(50))) description = TextArea(label_text=l_('Description'), rows=TA_ROWS, cols=TA_COLS)