Esempio n. 1
0
 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"),
                                                    vocabulary_factory="collective.tablepage.vocabulary.row_options"),
                   },
               ),
               ),
Esempio n. 2
0
                "If the return value is None then the adapter will use request.form "
                "If the return value is a dictionary then the adapter will use the "
                "returned dictionary. "
                "PLEASE NOTE: errors in the evaluation of this expression will "
                "cause an error on form display."),
            size=70,
            ),
        ),
    DataGridField(
        name='field_map',
        widget=DataGridWidget(
            label=u'Field Map',
            description=u"Map the PFG field to the Sharepoint list column.",
            columns={
                'pfg_field': SelectColumn(u'PFG Field',
                                          vocabulary='fgFieldsDisplayList',),
                'sharepoint_column': SelectColumn(u'Sharepoint Column',
                                                  vocabulary='getColumnsVocab'),
                },
            ),
        allow_empty_rows=False,
        required=False,
        columns=('pfg_field', 'sharepoint_column'),
    ),

    #DataGridField(
    #    name='upload_field_map',
    #    widget=DataGridWidget(
    #        label=u'Field Map',
    #        description=u"Map the PFG field to the Sharepoint list column.",
    #        columns={
    #            'pfg_field': SelectColumn(u'PFG Field',
    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.
Esempio n. 4
0
 DataGridField(
     name='availableAreas',
     default=({
         'id': 'ui',
         'title': 'User interface',
         'description': 'User interface issues'
     }, {
         'id': 'functionality',
         'title': 'Functionality',
         'description': 'Issues with the basic functionality'
     }, {
         'id':
         'process',
         'title':
         'Process',
         'description':
         'Issues relating to the development process itself'
     }),
     widget=DataGridWidget(
         label=_(u'Poi_label_availableAreas', default=u"Areas"),
         description=_(
             u'Poi_help_availableAreas',
             default="Enter the issue topics/areas for this tracker."),
         column_names=('Short name', 'Title', 'Description'),
     ),
     allow_empty_rows=False,
     required=True,
     validators=('isDataGridFilled', ),
     columns=(
         'id',
         'title',
         'description',
     )),
            "Enter any introductory help text you'd like to display on the tracker front page.",
            label_msgid='gcommons_label_helpText',
            description_msgid='gcommons_help_helpText',
            i18n_domain='gcommons.Core',
        ),
        default_output_type='text/html',
        searchable=True,
        default="""
        <h3>Payment system</h3>
        """),
    DataGridField(
        name='items',
        widget=DataGridWidget(
            label=_("Items"),
            description=
            _('Take your time to fill in the items that will be billed. For radio buttons use same id plus colon (see help).'
              ),
            column_names=('Id', 'Name', 'Description', 'Price'),
        ),
        allow_empty_rows=False,
        required=False,
        columns=('id', 'name', 'description', 'price')),
))


def finalizeConferencePaymentSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()
    schemata.finalizeATCTSchema(schema, moveDiscussion=False)
    return schema

 DataGridField(
     'fieldMapping',
     required=False,
     write_permission=ModifyPortalContent,
     read_permission=ModifyPortalContent,
     storage=atapi.AnnotationStorage(),
     searchable=False,
     allow_delete=True,
     allow_insert=True,
     allow_reorder=True,
     columns=('form', 'content'),
     widget=DataGridWidget(
         label=_('field_mapping_label', default=u'Field mapping'),
         description=_('field_mapping_help',
                       default=u'Map form fields to field of the '
                       u'selected content type. Please note, '
                       u'that you must first select the '
                       u'content type, then save this adapter, '
                       u"and only then you'll be able to see the "
                       u'fields of the selected content type.'),
         columns={
             'form':
             SelectColumn(_('field_mapping_form_label',
                            default=u'Select a form field'),
                          vocabulary='listFormFields'),
             'content':
             SelectColumn(_('field_mapping_content_label',
                            default=u'to be mapped to a content field.'),
                          vocabulary='listContentFields')
         },
     )),
Esempio n. 7
0
    ),

    # This field is used
    #    if invitations are allowed, and users enforced: to hold invitations, else hidden
    #    if gcommons.Users not installed, to hold users
    DataGridField(
        name='unregisteredRelators',
        widget=DataGridWidget(
            label=_("Other Authors"),
            condition="here/condition_unregistered",
            description=
            _('If applicable, other authors or contributors of the paper or persons responsible for this piece, besides the principal author.'
              ),
            columns={
                'relationship':
                SelectColumn(_(u'Relation'), vocabulary="listRelatorTypes"),
                'name':
                Column(_(u'Name')),
                'institution':
                Column(_('Institution')),
                'email':
                Column(_('email')),
            },
        ),
        allow_empty_rows=False,
        required=False,
        columns=('relationship', 'name', 'institution', 'email')),

    #
    # Overrride default fields creators and contributors
    atapi.ComputedField(
        name='creators',