def __init__(self, label, default=None, label_msgid=None, visible=True):
        """ Create a column

            @param hide Hide column from displaying
        """
        Column.__init__(self, label, default, label_msgid)
        self.visible = visible
예제 #2
0
    def __init__(self, label, default=None, label_msgid=None, visible=True):
        """ Create a column

            @param hide Hide column from displaying
        """
        Column.__init__(self, label, default, label_msgid)
        self.visible = visible
예제 #3
0
    def __init__(self, title, helper_text, script, icon):
        """ Create a HelpColumn

        """
        Column.__init__(self, title)
        self.helper_text = helper_text
        self.helper_url = script
        self.icon = icon
예제 #4
0
    def __init__(self, title, linkClass=""):
        """ Create a Links

        @param linkClass CSS class for <a> links in view mode

        """
        Column.__init__(self, title)
        self.linkClass = linkClass
    def __init__(self, title, vocabulary, default=None):
        """ Create a SelectColumn

        @param vocabulary Vocabulary method name. This method is called
               from Archetypes instance to get values for dropdown list.
        """
        Column.__init__(self, title, default=default)
        self.vocabulary = vocabulary
예제 #6
0
파일: HelpColumn.py 프로젝트: dtgit/dtedu
 def __init__(self, title, helper_text, script, icon):
     """ Create a HelpColumn
     
     """
     Column.__init__(self, title)
     self.helper_text = helper_text
     self.helper_url = script
     self.icon = icon
예제 #7
0
    def __init__(self, title, linkClass=""):
        """ Create a Links

        @param linkClass CSS class for <a> links in view mode

        """
        Column.__init__(self, title)
        self.linkClass = linkClass
    def __init__(self, label, vocabulary, **kwargs):
        """ Create a SelectColumn

        @param vocabulary Vocabulary method name. This method is called
               from Archetypes instance to get values for dropdown list.
        """
        Column.__init__(self, label, **kwargs)
        self.vocabulary = vocabulary
    def __init__(self, label, helper_text, script, icon, **kwargs):
        """ Create a HelpColumn

        """
        Column.__init__(self, label, **kwargs)
        self.helper_text = helper_text
        self.helper_url = script
        self.icon = icon
    def __init__(self, label, helper_text, script, icon, **kwargs):
        """ Create a HelpColumn

        """
        Column.__init__(self, label, **kwargs)
        self.helper_text = helper_text
        self.helper_url = script
        self.icon = icon
예제 #11
0
파일: SelectColumn.py 프로젝트: a25kk/stv2
    def __init__(self, title, vocabulary, default=None):
        """ Create a SelectColumn

        @param vocabulary Vocabulary method name. This method is called
               from Archetypes instance to get values for dropdown list.
        """
        Column.__init__(self, title, default=default)
        self.vocabulary = vocabulary
    def __init__(self, label, **kwargs):
        """ Create a Links

        @param linkClass CSS class for <a> links in view mode

        """
        linkClass = kwargs.pop('linkClass', '')
        Column.__init__(self, label, **kwargs)
        self.linkClass = linkClass
 def __init__(self, label, col_description=None, default=None, default_method=None,
              date_format="yy/mm/dd", required=False):
     if required or col_description:
         # sorry for this trick, but we are using this product with a custom DataGridField 1.6.4
         # see https://github.com/RedTurtle/Products.DataGridField/tree/1.6
         Column.__init__(self, label, col_description=col_description, default=default,
                         default_method=default_method, required=required)
     else:
         Column.__init__(self, label, default=default, default_method=default_method)
     self.date_format = date_format
예제 #14
0
 def __init__(self, label, col_description=None, default=None, default_method=None,
             required=False, object_provides=[], surf_site=True, search_site=True):
     if required or col_description:
         # sorry for this trick, but we are using this product with a custom DataGridField 1.6.4
         # see https://github.com/RedTurtle/Products.DataGridField/tree/1.6
         Column.__init__(self, label, col_description=col_description, default=default,
                         default_method=default_method, required=required)
     else:
         Column.__init__(self, label, default=default, default_method=default_method)
     self.object_provides = object_provides
     self.surf_site = surf_site
     self.search_site = search_site
    def __init__(self, label, default=None, label_msgid=None,
                 trigger_key=None, blur_handler="", focus_handler="",
                 class_no="", class_changed="", class_not_changed=""):
        """Create a column

            @param trigger_key
        """
        Column.__init__(self, label, default, label_msgid)
        self.trigger = trigger_key
        self.blur_handler = blur_handler and blur_handler + "(event)" or ""
        self.focus_handler = focus_handler and focus_handler + "(event)" or ""
        self.class_no = class_no
        self.class_not_changed = class_not_changed
        self.class_changed = class_changed
예제 #16
0
def update_meeting_schema(baseSchema):
    specificSchema = Schema((DataGridField(
        name='sections',
        widget=DataGridField._properties['widget'](
            description="Commissions",
            description_msgid="commissions_descr",
            condition=
            "python: here.portal_type in ('MeetingCouncil', 'MeetingZCouncil')",
            columns={
                'name_section':
                SelectColumn("Commission name",
                             vocabulary="listSections",
                             col_description="Select the commission name."),
                'date_section':
                Column("Commission date",
                       col_description="Enter valid from date, "
                       "use following format : DD/MM/YYYY."),
            },
            label='Commissions',
            label_msgid='MeetingSeraing_label_commissions',
            i18n_domain='PloneMeeting',
        ),
        allow_oddeven=True,
        write_permission="Modify portal content",
        columns=('name_section', 'date_section'),
        allow_empty_rows=False,
    ), ), )

    completeSchema = baseSchema + specificSchema.copy()

    baseSchema[
        'notes'].widget.description_msgid = "MeetingSeraing_descr_meeting_notes"
    baseSchema[
        'notes'].widget.label_msgid = "MeetingSeraing_msgid_meeting_notes"
    return completeSchema
예제 #17
0
    def __init__(self, label, col_description=None, vocabulary=None, vocabulary_factory=None, default=None,
                 default_method=None, required=False):
        """ Create a SelectColumn

        @param vocabulary Vocabulary method name. This method is called
               from Archetypes instance to get values for dropdown list.
        @param vocabulary_factory Vocabulary utility.
        """
        # do not call base SelectColumn constructor
        if required or col_description:
            # sorry for this trick, but we are using this product with a custom DataGridField 1.6.4
            # see https://github.com/RedTurtle/Products.DataGridField/tree/1.6
            Column.__init__(self, label, col_description=col_description, default=default,
                            default_method=default_method, required=required)
        else:
            Column.__init__(self, label, default=default, default_method=default_method)
        self.vocabulary = vocabulary
        self.vocabulary_factory = vocabulary_factory
예제 #18
0
class MultiDataProvenanceSchemaExtender(object):
    """ Schema extender for content types with data provenance
    """
    implements(ISchemaExtender, IBrowserLayerAwareExtender)

    layer = IDavizLayer

    fields = (
        DavizDataGridField(
            name='provenances',
            schemata='Data Provenance',
            searchable=False,
            widget=DataGridWidget(
                label="Data Provenance",
                description="""List of Data Provenance""",
                columns={
                    'title': Column("Title", required=False),
                    'link': Column("Link", required=False),
                    'owner': OwnerColumn
                },
                auto_insert=False,
                i18n_domain='eea',
                helper_js=widget_helper_js,
                helper_css=('++resource++eea.daviz.datasource.css',
                            'datagridwidget.css')),
            columns=("title", "link", "owner"),
            required=False,
            required_for_published=True),
        DavizBooleanField(name='inheritedprovenance',
                          schemata='Data Provenance',
                          searchable=False,
                          widget=BooleanWidget(
                              label='Inherited Provenance',
                              description='Inherited Provenance',
                          )),
    )

    def __init__(self, context):
        self.context = context

    def getFields(self):
        """ Returns provenance list field
        """
        return self.fields
class InvalidDataGridDemoType(atapi.BaseContent):
    """ DataGridField declaration with errors

    Errors should be detected run-time, with helpful error messages.

    This class is missing column definition select_sample in DataGridWidget
    """
    security = ClassSecurityInfo()

    schema = atapi.BaseSchema + atapi.Schema((DataGridField(
        'DemoField',
        searchable=True,
        columns=("column1", "column2", "select_sample"),
        widget=DataGridWidget(columns={
            'column1': Column(_(u"Toholampi city rox")),
            'column2': Column(_(u"My friendly name")),
        }, ),
    ), ))

    meta_type = portal_type = archetype_name = 'InvalidDataGridDemoType'
예제 #20
0
 def __init__(self,
              label,
              default=None,
              label_msgid=None,
              trigger_key=None,
              blur_handler="",
              focus_handler="",
              class_no="",
              class_changed="",
              class_not_changed=""):
     """ Create a column
     
         @param trigger_key
     """
     Column.__init__(self, label, default, label_msgid)
     self.trigger = trigger_key
     self.blur_handler = blur_handler and blur_handler + "(event)" or ""
     self.focus_handler = focus_handler and focus_handler + "(event)" or ""
     self.class_no = class_no
     self.class_not_changed = class_not_changed
     self.class_changed = class_changed
    def __init__(self, label, default=None, label_msgid=None,
                 column_on_class=None, column_off_class=None,
                 columns=[], invert=False, read_only=None):
        """Create a column, with adding class attribute depend on value
        presence for the cell.

            @param column_on_class set class, which will be added to the
                <input> tag if columns has value
            @param column_off_class set class, which will be added to the
                <input> tag if columns not has value
            @param columns list of columns names, which values will be checked
                for set class attribute
            @param invert - invert the adding class logic
            @param read_only - check-on/off readOnly attribute for the <input>
                tag
        """
        Column.__init__(self, label, default, label_msgid)
        self.column_on_class = column_on_class
        self.column_off_class = column_off_class
        self.columns = columns
        self.invert = invert
        self.read_only = read_only
예제 #22
0
 def __init__(self,
              label,
              default=None,
              label_msgid=None,
              column_on_class=None,
              column_off_class=None,
              columns=[],
              invert=False,
              read_only=None):
     """ Create a column, with adding class attribute depend on value presence for the cell.
     
         @param column_on_class set class, which will be added to the <input> tag if columns has value
         @param column_off_class set class, which will be added to the <input> tag if columns not has value
         @param columns list of columns names, which values will be checked for set class attribute
         @param invert - invert the adding class logic
         @param read_only - check-on/off readOnly attribute for the <input> tag
     """
     Column.__init__(self, label, default, label_msgid)
     self.column_on_class = column_on_class
     self.column_off_class = column_off_class
     self.columns = columns
     self.invert = invert
     self.read_only = read_only
    def getColumnDefinition(self, field, id):
        """ Return Column instance for column id """

        if id in getattr(self, 'columns', {}).keys():
            return self.columns[id]

        # Backwards compatability/shortcut
        if id in field.columns:
            label = id
            columnNames = getattr(self, 'column_names', None)
            if columnNames and len(columnNames) == len(field.columns):
                idx = list(field.columns).index(id)
                label = columnNames[idx]

            return Column(label)

        raise KeyError, "Tried to look up missing column definition for: " + str(id)
예제 #24
0
 DataGridField(
     name='arg_spec',
     widget=DataGridWidget(
         label="Arguments",
         description="""Provide names, types and queries for the arguments.
                 Names and types are mandatory, but you can leave the
                 query field empty.
                 Details and a full tutorial on how to work with
                 arguments <a
                 href="++resource++eea.sparql.documentation/api/index.html"
                 title="tutorial">here.</a>
                     """,
         auto_insert=False,
         i18n_domain='eea',
         columns={
             'name': Column("Name"),
             'query': LinesColumn("Query")
         },
         helper_js=(
             '++resource++eea.sparql.datasource.js',
             'datagridwidget.js',
         ),
         helper_css=('++resource++eea.sparql.datasource.css',
                     'datagridwidget.css')),
     columns=("name", "query")),
 TextField(name='sparql_query',
           default_content_type='text/plain',
           allowable_content_types=('text/plain', ),
           widget=TextAreaWidget(
               macro="sparql_textfield_with_preview",
               helper_js=("sparql_textfield_with_preview.js", ),
예제 #25
0
        required=False,
    ),
    atapi.StringField(
        name='categoria',
        widget=atapi.SelectionWidget(label=_(u"Assunto"), ),
        required=False,
        vocabulary='vocCategorias',
    ),
    DataGridField(
        name='sitesrelacionados',
        searchable=False,
        columns=("url", "description"),
        widget=DataGridWidget(
            label=_(u"Sites relacionados"),
            columns={
                'url': Column("URL"),
                'description': Column("Descrição da URL"),
            },
        ),
    ),

    # atapi.ReferenceField(
    #     name='anexos',
    #     widget = ReferenceBrowserWidget(
    #         label=_(u"Anexos"),
    #     ),
    #     type=['File', 'ArquivoBiblioteca'],
    #     required=True,
    #     multiValued=True,
    # )
    FileField(
예제 #26
0
                        rows=25,
                        allow_file_upload=zconf.ATDocument.allow_document_upload),
    ),

    DataGridField('pageColumns',
                  required=True,
                  storage=atapi.AnnotationStorage(),
                  columns=("id", "label", "description", "type", "vocabulary", "options"),
                  widget=DataGridWidget(
                      label=_(u"Columns"),
                      description=_('help_pageColumns',
                                    default=u"Definition of rows inside the table"),
                      visible={'view': 'invisible', 'edit': 'visible'},
                      helper_js=('datagridwidget.js', 'datagridwidget_patches.js', 'datagridmultiselect.js'),
                      columns={
                          'id': Column(_(u"Column id"), required=True),
                          'label': Column(_(u"Column label"), required=True),
                          'description': TextAreaColumn(_(u"Column description")),
                          'type': SelectColumn(_(u"Type of data"),
                                               vocabulary_factory="collective.tablepage.vocabulary.column_types",
                                               required=True,
                                               default="String"),
                          'vocabulary': TextAreaColumn(_(u"Column configuration"),
                                                       col_description=_("vocabulary_column_description",
                                                                         default=u"Some columns types will need this.\n"
                                                                                 u"For \"Select\" type: used for defining the "
                                                                                 u"vocabulary (one item on per row).\n"
                                                                                 u"For \"Computed\" type: write there the TALES expression.")),
                          'options': MultiSelectColumn(_(u"Additional features"),
                                                       col_description=_("options_column_description",
                                                                         default=u"Other options you can activate on the column"),
class DataGridDemoType2(atapi.BaseContent):
    """ Demo for different DataGridWidget columns

    This class is used in unit testing

    Check manual that:
        - Rows are inserted automatically when a value is filled in
        - Select column has sample 2 as a default value
    """
    security = ClassSecurityInfo()

    schema = atapi.BaseSchema + atapi.Schema((
        DataGridField(
            'AutoInsertDemoField',
            searchable=True,  # One unit tests checks whether text search works
            columns=("column1", "column2", "column3"),
            allow_empty_rows=
            False,  # Must be false to make auto insert feature perform correctly
            widget=DataGridWidget(
                auto_insert=True,
                description=
                "Automatically insert new rows when the last row is being filled. When you edit the last row, a new row is created automatically.",
                description_msgid='DataGridDemoType_help_AutoInsertRows',
                i18n_domain='datagridfield',
                columns={},
            ),
        ),
        DataGridField(
            'DemoField2',
            searchable=True,  # One unit tests checks whether text search works
            columns=("column1", "column2", "select_sample"),
            widget=DataGridWidget(
                description=
                "Set default values for created rows. Choose SelectColumn value from the default dictionary",
                description_msgid='DataGridDemoType_help_DemoField2',
                i18n_domain='datagridfield',
                columns={
                    'column1':
                    Column(_(u"Toholampi city rox")),
                    'column2':
                    Column(_(u"My friendly name"),
                           default=_(u"Some default text")),
                    'select_sample':
                    SelectColumn(_(u"Friendly name"),
                                 vocabulary="getSampleVocabulary",
                                 default="sample2")
                },
            ),
        ),
        DataGridField(
            'DemoField3',
            columns=("column1", "column2"),
            widget=DataGridWidget(
                description="Test radio and checkbox columns",
                description_msgid='DataGridDemoType_help_DemoField3',
                i18n_domain='datagridfield',
                columns={
                    'column1':
                    RadioColumn("Radio column",
                                vocabulary="getSampleVocabulary"),
                    'column2':
                    CheckboxColumn("Checkbox column")
                },
            ),
        ),
        DataGridField(
            'DemoField4',
            columns=("text_column", "help_column"),
            widget=DataGridWidget(
                description="Help column test",
                description_msgid='DataGridDemoType_help_DemoField4',
                i18n_domain='datagridfield',
                columns={
                    'text_column':
                    Column("Text column"),
                    # Help is help.pt
                    'help_column':
                    HelpColumn("Help", _(u"See help here"), "help", "info.gif")
                },
            ),
        ),
    ))

    meta_type = portal_type = archetype_name = 'DataGridDemoType2'

    def getSampleVocabulary(self):
        """Get a sample vocabulary
        """
        return atapi.DisplayList((
            (
                "sample",
                _(u"Sample value 1"),
            ),
            (
                "sample2",
                _(u"Sample value 2"),
            ),
        ))
예제 #28
0
class DataGridDemoType2(atapi.BaseContent):
    """ Demo for different DataGridWidget columns

    This class is used in unit testing

    Check manual that:
        - Rows are inserted automatically when a value is filled in
        - Select column has sample 2 as a default value
    """
    security = ClassSecurityInfo()

    schema = atapi.BaseSchema + atapi.Schema((

        DataGridField('AutoInsertDemoField',
                searchable=True, # One unit tests checks whether text search works
                columns=("column1", "column2", "column3"),
                allow_empty_rows = False, # Must be false to make auto insert feature perform correctly
                widget = DataGridWidget(
                    auto_insert = True,
                    description="Automatically insert new rows when the last row is being filled. When you edit the last row, a new row is created automatically.",
                    description_msgid='DataGridDemoType_help_AutoInsertRows',
                    i18n_domain='datagridfield',
                    columns={
                    },
                 ),
         ),

        DataGridField('DemoField2',
                searchable=True, # One unit tests checks whether text search works
                columns=("column1", "column2", "select_sample"),
                widget = DataGridWidget(
                    description="Set default values for created rows. Choose SelectColumn value from the default dictionary",
                    description_msgid='DataGridDemoType_help_DemoField2',
                    i18n_domain='datagridfield',
                    columns={
                        'column1' : Column(_(u"Toholampi city rox"), required=True, col_description=_(u"Go Toholampi or go home.")),
                        'column2' : Column(_(u"My friendly name"), default=_(u"Some default text")),
                        'select_sample' : SelectColumn(_(u"Friendly name"), vocabulary="getSampleVocabulary", default="sample2")
                    },
                 ),
         ),

        DataGridField('DemoField3',
                columns=("column1", "column2"),
                widget = DataGridWidget(
                    description="Test radio and checkbox columns",
                    description_msgid='DataGridDemoType_help_DemoField3',
                    i18n_domain='datagridfield',
                    columns={
                        'column1' : RadioColumn("Radio column", vocabulary="getSampleVocabulary"),
                        'column2' : CheckboxColumn("Checkbox column")
                    },
                 ),
         ),

        DataGridField('DemoField4',
                columns=("text_column", "help_column"),
                widget = DataGridWidget(
                    description="Help column test",
                    description_msgid='DataGridDemoType_help_DemoField4',
                    i18n_domain='datagridfield',
                    columns={
                        'text_column' : Column("Text column"),
                        # Help is help.pt
                        'help_column' : HelpColumn("Help", _(u"See help here"), "help", "info.png")
                    },
                 ),
         ),

        DataGridField('DemoField5',
                columns=("link_column",),
                widget = DataGridWidget(
                    description="Set of links",
                    columns={
                        'link_column' : LinkColumn("Link column"),
                    },
                 ),
         ),

        DataGridField('DemoField6',
                columns=("date_column",),
                widget = DataGridWidget(
                    description="date column",
                    columns={
                        'date_column' : DateColumn("Date column"),
                    },
                 ),
         ),

        DataGridField('DemoField7',
                columns=("datetime_column",),
                widget = DataGridWidget(
                    description="datetime column",
                    columns={
                        'datetime_column' : DatetimeColumn("Datetime column"),
                    },
                 ),
         ),

        DataGridField('DemoField8',
                columns=("datetimelocal_column",),
                widget = DataGridWidget(
                    description="datetime column, local time zone",
                    columns={
                        'datetimelocal_column' : DatetimeLocalColumn("DatetimeLocal column"),
                    },
                 ),
         ),

        DataGridField('DemoField9',
                columns=("file_column",),
                widget = DataGridWidget(
                    description="file column",
                    columns={
                        'file_column' : FileColumn("File column"),
                    },
                 ),
         ),

        DataGridField('DemoField10',
                columns=("email_column",),
                widget = DataGridWidget(
                    description="email column",
                    columns={
                        'email_column' : EmailColumn("Email column"),
                    },
                 ),
         ),

        DataGridField('DemoField11',
                columns=("color_column",),
                widget = DataGridWidget(
                    description="color column",
                    columns={
                        'color_column' : ColorColumn("Color column"),
                    },
                 ),
         ),

        DataGridField('DemoField12',
                columns=("password_column",),
                widget = DataGridWidget(
                    description="password column",
                    columns={
                        'password_column' : PasswordColumn("Password column"),
                    },
                 ),
         ),

        DataGridField('DemoField13',
                columns=("range_column",),
                widget = DataGridWidget(
                    description="range column",
                    columns={
                        'range_column' : RangeColumn("Range column"),
                    },
                 ),
         ),

        DataGridField('DemoField14',
                columns=("month_column",),
                widget = DataGridWidget(
                    description="month column",
                    columns={
                        'month_column' : MonthColumn("Month column"),
                    },
                 ),
         ),

        DataGridField('DemoField15',
                columns=("search_column",),
                widget = DataGridWidget(
                    description="search column",
                    columns={
                        'search_column' : SearchColumn("Search column"),
                    },
                 ),
         ),

        DataGridField('DemoField16',
                columns=("time_column",),
                widget = DataGridWidget(
                    description="time column",
                    columns={
                        'time_column' : TimeColumn("Time column"),
                    },
                 ),
         ),

        DataGridField('DemoField17',
                columns=("url_column",),
                widget = DataGridWidget(
                    description="url column",
                    columns={
                        'url_column' : UrlColumn("Url column"),
                    },
                 ),
         ),

        DataGridField('DemoField18',
                columns=("week_column",),
                widget = DataGridWidget(
                    description="week column",
                    columns={
                        'week_column' : WeekColumn("Week column"),
                    },
                 ),
         ),


        ))

    meta_type = portal_type = archetype_name = 'DataGridDemoType2'

    def getSampleVocabulary(self):
        """Get a sample vocabulary
        """
        return atapi.DisplayList(

            (("sample", _(u"Sample value 1"),),
            ("sample2", _(u"Sample value 2"),),))
예제 #29
0
from Products.validation.validators.ExpressionValidator import ExpressionValidator

from ebc.pauta import pautaMessageFactory as _
from ebc.pauta.interfaces import IInfografia
from ebc.pauta.config import PROJECTNAME

InfografiaSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((


    DataGridField(
        name='telas',
        columns=("titulo", "texto", "texto_off"),        
        widget=DataGridWidget(
            label='Tela',
            columns={
                'titulo' : Column("Título"),
                'texto' : TextAreaColumn("Texto Letreiro/Fonte"),
                'texto_off' : TextAreaColumn("Texto do Off"),
            }            
        ),
        required=True,
    ),

    atapi.FileField(
        name='arquivo',
        widget=atapi.FileWidget(
            label='Arquivo do Off',
        ),
    ),

    atapi.DateTimeField(
예제 #30
0
PSCWorkplaceSchema = ATFolderSchema.copy() + Schema(
    (

        # Workplace configurtions.
        DataGridField(
            'psc_config_params',
            required=True,
            columns=('key', 'value', 'description'),
            allow_empty_rows=False,
            widget=DataGridWidget(
                label=u'Configuration Parameters',
                auto_insert=False,
                description="Please adding your configuration parameters here:",
                columns={
                    'key': Column("The Key"),
                    'value': Column("The Value"),
                    'description': Column("Description")
                },
            ),
        ), ), )

finalizeATCTSchema(PSCWorkplaceSchema)


# define the class.
class PSCWorkplace(ATFolder):
    """ 
    """

    schema = PSCWorkplaceSchema
예제 #31
0
     write_permission="PloneMeeting: Write risky config",
 ),
 DataGridField(
     name='certifiedSignatures',
     widget=DataGridField._properties['widget'](
         columns={
             'signatureNumber':
             SelectColumn(
                 "Certified signatures signature number",
                 vocabulary="listSignatureNumbers",
                 col_description=
                 "Select the signature number, keep signatures ordered by number."
             ),
             'name':
             Column(
                 "Certified signatures signatory name",
                 col_description=
                 "Name of the signatory (for example 'Mister John Doe')."),
             'function':
             Column("Certified signatures signatory function",
                    col_description=
                    "Function of the signatory (for example 'Mayor')."),
             'date_from':
             Column(
                 "Certified signatures valid from (included)",
                 col_description=
                 "Enter valid from date, use following format : YYYY/MM/DD, "
                 "leave empty so it is always valid."),
             'date_to':
             Column(
                 "Certified signatures valid to (included)",
                 col_description=
예제 #32
0
             'pop': '0',
             'emp': '0'
         },
         {
             'year': '2040',
             'pop': '0',
             'emp': '0'
         },
     ],
     widget=DataGridWidget(
         label=_(u"Projection"),
         description=
         _(u"Enter as many population and employment values as needed.  Intermediate values will be calculated automatically."
           ),
         columns={
             'year': Column(_(u"Year"), default='2010'),
             'pop': Column(_(u"Population"), default='0'),
             'emp': Column(_(u"Employment"), default='0'),
         }),
     required=True,
 ),
 atapi.ReferenceField(
     'zone',
     storage=atapi.AnnotationStorage(),
     widget=ReferenceBrowserWidget(
         label=_(u"Effective Zone"),
         description=
         _(u"Select a subregional map defining the effective modeling zone."
           ),
         startup_directory='/luc/projections/subregional'),
     relationship='projection_zone',
예제 #33
0
        allowed_types=('ReviewOfSystems', ),
        relationship='Owns',
        widget=ReferenceWidget(
            label=_('Review of Systems'),
            macro='ros_reference',
        ),
    ),
    DataGridField(
        'allergies',
        columns=('allergy', 'reaction'),
        allow_empty_rows=False,
        allow_oddeven=True,
        widget=DataGridWidget(
            label=_('Allergies'),
            columns={
                'allergy': Column('Alergia'),
                'reaction': SelectColumn('Reação',
                                         vocabulary='getReactionValues'),
            },
        ),
    ),

    #DataGridField('medication_taken',
    #columns=('medication', 'mg', 'use', 'start'),
    #allow_empty_rows = False,
    #allow_oddeven=True,
    #widget=DataGridWidget(
    #label=_('Medicamentos em uso'),
    #columns={
    #'medication' : Column('Medicamento'),
    #'mg' : Column('Concentração'),
예제 #34
0
     columns=('value', 'sf_field'),
     allow_delete=True,
     allow_insert=True,
     allow_reorder=False,
     widget=DataGridWidget(
         label=_(u'Preset field values'),
         description=
         _(u"You may optionally configure additional values that should be mapped "
           u"to Salesforce fields.  The same value will be passed each time the form "
           u"is submitted.  For example, this could be used to set the LeadSource for "
           u"a new Lead to 'web'.  You may also use TALES path expressions (starting "
           u"with 'path:') or Python expressions (starting with 'python:').  Use 'now' "
           u"to submit the current time."),
         columns={
             'value':
             Column('Value'),
             'sf_field':
             SelectColumn('Salesforce Field',
                          vocabulary='buildSFFieldOptionList')
         }),
 ),
 DataGridField(
     'dependencyMap',
     searchable=0,
     required=0,
     read_permission=ModifyPortalContent,
     schemata='field mapping',
     columns=('adapter_name', 'adapter_id', 'sf_field'),
     fixed_rows="getLocalSFAdapters",
     allow_delete=False,
     allow_insert=False,
    StringField( 
       name='group', 
       widget=StringWidget( 
           label="Group", 
           description="Flickr group NSID (e.g. 31939107@N00), used to Retrieve pictures from a group, leave this blank to retrieve pictures by the username above", 
           label_msgid='flickrgallery_label_username', 
           description_msgid='flickrgallery_help_username', 
           i18n_domain='flickrgallery', 
      ) 
   ), 

DataGridField(
        name='categories',
        columns=('category','tags'),
        widget=DataGridField._properties['widget'](
            columns={ 'category' : Column("Category"), 'tags':Column("Tags") },
            label='Categories',
            description_msgid='flickrgallery_help_categories',
            label_msgid='flickrgallery_label_categories',
            i18n_domain='flickrgallery',
        )
    ),

),
)

##code-section after-local-schema #fill in your manual code here

##/code-section after-local-schema

FlickrGallery_schema = ATDocumentSchema.copy() + \
예제 #36
0
logger = logging.getLogger('eea.indicators.content.Specification')

ONE_YEAR = datetime.timedelta(weeks=52)

trimesters = ['Q1', 'Q2', 'Q3', 'Q4']

frequency_of_updates_schema = Schema((

    DataGridField(
        name='frequency',
        searchable=False,
        widget=DataGridWidget(
            label="Frequency of updates",
            description="",
            columns={'years_freq':
                        Column("Years frequency"),
                     },
            auto_insert=False,
            label_msgid='indicators_label_codes',
            i18n_domain='indicators',
            ),
        columns=("years_freq",),
        required_for_published=True,
        #validators=('isInt',),
        #allow_empty_rows=True,
        ),
    DateTimeField(
        name='starting_date',
        #required=True,
        widget=CalendarWidget(
            label="Starting with this date, indicator is published at " \
예제 #37
0
     ),
 ),
 DataGridField(
     name='codes',
     widget=DataGridWidget(
         label="Identification codes",
         description=
         "Codes are short names used to identify the indicator"
         " in question. Code is made up of a SET-ID and an "
         "CODE-NR, e.g. TERM 002. Multiple codes are allowed, "
         "since same indicator can be re-used in other "
         "indicators' sets.",
         columns={
             'set': SelectColumn("Set ID",
                                 vocabulary="get_indicator_codes"),
             "code": Column("Code number")
         },
         auto_insert=False,
         label_msgid='indicatorsfactsheet_label_codes',
         i18n_domain='indicators',
     ),
     columns=("set", "code"),
     required_for_published=True,
     searchable=True,
 ),
 EEAReferenceField(
     'relatedItems',
     relationship='relatesTo',
     multiValued=True,
     isMetadata=False,
     #referencesSortable=True,
예제 #38
0
        widget=atapi.TextAreaWidget(
            label="Visita técnica",
            description="Preencha o relatório da visita técnica.",
        ),
        allowable_content_types="('text/html')",
        default_output_type="text/html",
        searchable=1,
    ),

    DataGridField(
        name='veiculacao',
        columns=("descricao", "entrada", "saida" ),
        widget=DataGridWidget(
            label="Veiculação",
            columns={
                'descricao': Column("Descricao"),
                'entrada':  Column("Entrada"),
                'saida':  Column("Saida"),
            },
        ),
        required=True,
    ),

    atapi.ComputedField(
        'duracao',
        expression='context.duracaoTotal()',
        storage=atapi.AnnotationStorage(),
        widget=atapi.ComputedWidget(
            label="Duração da transmissão",
            modes=('view')
        ),
예제 #39
0
파일: doctor.py 프로젝트: marcellobax/cmed
        ),        

        DataGridField('curriculum',
            description='Estas informações serão apresentadas em seu cartão de visita virtual.',
            columns=('tipo', 'course', 'inst'),
            allow_empty_rows = False,
            allow_oddeven=True,
            allow_reorder = False,
            fixed_rows = [
                FixedRow(keyColumn="course", initialData = { "tipo" : "", "course" : "Medicina", "inst" : "" }),
            ],                
            widget=DataGridWidget(
                label='Curriculum',
                columns={
                    'tipo' : SelectColumn('Tipo', vocabulary='getCourseTypes'),
                    'course' : Column('Área'),
                    'inst' : Column('Instituição'),
                },
            ),
        ),

))
set_schemata_properties(MAIN, schemata='Principal')

PASSWORD = Schema((
         StringField('password',
            validators = ('isCurrentPassword',),
            widget=PasswordWidget(
                label='Senha Atual',
                condition='python:object.showPasswordCondition()',
            ),
예제 #40
0
    StringField(
        'title',
        required=True,
        searchable=0,
        default='List of Students',
        widget=StringWidget(
            label='Title',
            description='title',
        ),
    ),
    DataGridField(
        'StudentIdList',
        searchable=True,  # One unit tests checks whether text search works
        widget=DataGridWidget(label='StudentIds',
                              columns={
                                  "studentid": Column("Student Id"),
                                  "randomnumber": Column("Random id number"),
                                  "email": Column("Student email"),
                              }),
        columns=('studentid', 'randomnumber', 'email'),
    ),
))

#########################################################
## check can course code be editited??????, if not FIXME
########################################################


class StudentTesting(base.ATCTContent):
    """
    A Course belongs to a specific Department although it can contain tutorials from any Department.