Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
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'
Ejemplo n.º 3
0
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'
Ejemplo n.º 4
0
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'
Ejemplo n.º 5
0
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'
Ejemplo n.º 6
0
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'
Ejemplo n.º 7
0
 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()
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 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')))
Ejemplo n.º 11
0
 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')))
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
 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)
Ejemplo n.º 14
0
 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)
Ejemplo n.º 15
0
 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)
Ejemplo n.º 16
0
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'
Ejemplo n.º 17
0
 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')))
Ejemplo n.º 18
0
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'
Ejemplo n.º 19
0
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'
Ejemplo n.º 20
0
    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')))
Ejemplo n.º 21
0
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'
Ejemplo n.º 22
0
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'
Ejemplo n.º 23
0
 def display(self, value=None, **kwargs):
     if value:
         value = line_break_xhtml(value)
     return TextArea.display(self, value, **kwargs)
Ejemplo n.º 24
0
 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)
Ejemplo n.º 25
0
 class fields(WidgetsList):
     title = TextField()
     year = TextField(size=4, default=1984)
     description = TextArea()
Ejemplo n.º 26
0
 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)