Exemple #1
0
class PrincipalFull(PrincipalBasic):
    name = colander.SchemaNode(
        colander.String(),
        title=_(u'Name'),
        validator=colander.All(name_pattern_validator, name_new_validator),
    )
    password = colander.SchemaNode(
        colander.String(),
        title=_(u'Password'),
        validator=colander.Length(min=5),
        missing=None,
        widget=CheckedPasswordWidget(),
    )
    active = colander.SchemaNode(
        colander.Boolean(),
        title=_(u'Active'),
        description=_(u"Untick this to deactivate the account."),
    )
    roles = colander.SchemaNode(
        deform.Set(allow_empty=True),
        validator=roleset_validator,
        missing=[],
        title=_(u"Global roles"),
        widget=CheckboxChoiceWidget(),
    )
    groups = Groups(
        title=_(u'Groups'),
        missing=[],
        # XXX min_len doesn't really do what we want here.  We'd like
        # the close buttons to appear nevertheless (maybe the now
        # deprecated render_initial_item did exactly that).
        widget=SequenceWidget(min_len=1),
    )
Exemple #2
0
class ManageConnectedProfilesSchema(colander.Schema):
    auth_domains = colander.SchemaNode(
        deform.Set(allow_empty=True),
        title=u"Remove domains?",
        missing=colander.null,
        widget=deferred_local_profile_information_widget,
    )
Exemple #3
0
 class Schema(colander.Schema):
     countries = colander.SchemaNode(
         deform.Set(allow_empty=True),
         widget=ChosenMultipleWidget(values=choices,
                                     placeholder=u'Select countries'),
         missing=colander.null,
     )
Exemple #4
0
def create_html_view():
    from .....flexible_datagrabber import create_datagrabber_html_view
    import colander
    import deform
    from colander import SchemaNode as sn
    conf = colander.SchemaNode(colander.Mapping())

    dirs = colander.SchemaNode(colander.Mapping(),name='Directories')
    dirs.add(colander.SchemaNode(colander.String(),name='working_dir'))
    dirs.add(colander.SchemaNode(colander.String(),name='sink_dir'))
    dirs.add(colander.SchemaNode(colander.String(),name='surf_dir'))
    dirs.add(colander.SchemaNode(colander.String(),name='crash_dir'))

    x_opts = colander.SchemaNode(colander.Mapping(),name='Execution Options')
    x_opts.add(colander.SchemaNode(colander.Bool(),name='run_using_plugin',default=True))
    x_opts.add(colander.SchemaNode(deform.Set(),
                                   widget=deform.widget.SelectWidget(values=[('PBS','PBS'),
                                    ('PBSGraph','PBSGraph'),
                                    ('Condor','Condor'),
                                    ('CondorDAGMan','CondorDAGMan')
                                    ('MultiProc','MultiProc')]),
                                    name='plugin'))
    x_opts.add(sn(colander.String(),name='plugin_args',default='{\'qsub_args\':\'-q many\'}'))
    x_opts.add(sn(colander.Bool(),name='test_mode')) 
    x_opts.add(sn(colander.Bool(),name='save_script_only'))

    conf.add(dirs)
    conf.add(x_opts)

    return conf
Exemple #5
0
def getNode(_type,tr,config):
    from bips.workflows.flexible_datagrabber import Data, DataBase
    if _type == type(traits.Int()):
            col_type = colander.SchemaNode(colander.Int(),
                                           name=tr,description=config.trait(tr).desc)
    elif _type == type(traits.Float()):
        col_type = colander.SchemaNode(colander.Decimal(),name=tr)    
        
    elif _type == type(traits.String()) or _type==type(traits.Str()):
        col_type = colander.SchemaNode(colander.String(),name=tr)
        
    elif _type == type(traits.Enum('')):
        values=config.trait(tr).trait_type.values
        the_values = []
        for v in values:
            the_values.append((v,v))
        col_type = colander.SchemaNode(
            deform.Set(),
            widget=deform.widget.SelectWidget(values=the_values),
            name=tr)
    elif _type == type(traits.Bool()):
        col_type = colander.SchemaNode(colander.Boolean(),widget=deform.widget.CheckboxWidget(),name=tr)
    elif _type == type(traits.Code()):
        col_type = colander.SchemaNode(colander.String(),name=tr,widget=deform.widget.TextAreaWidget(cols=100,rows=20))
    elif _type == type(traits.Instance(Data,())):
        from bips.workflows.flexible_datagrabber import create_datagrabber_html_view
        col_type = create_datagrabber_html_view() 
    elif _type == type(traits.List()):
        col_type =get_list(_type,tr,config) 
    else:
        print "type: ", _type, "not found!"
        col_type = colander.SchemaNode(colander.String(),name=tr)
    return col_type
Exemple #6
0
class PollSchema(colander.MappingSchema):
    title = colander.SchemaNode(colander.String(),
                                title = _(u"Title"),
                                validator=html_string_validator,)
    description = colander.SchemaNode(colander.String(),
                                      title = _(u"Description"),
                                      missing=u"",
                                      description = _(u"poll_description_description",
                                                      default=u"Explain your choice of poll method and your plan for the different polls in the agenda item."),
                                      widget=deform.widget.RichTextWidget(), 
                                      validator=richtext_validator,)

    poll_plugin = colander.SchemaNode(colander.String(),
                                      title = _(u"Poll method to use"),
                                      description = _(u"poll_poll_plugin_description",
                                                      default=u"Each poll method should have its own documentation. "
                                                        u"The standard ones from VoteITwill be in the manual - check the help menu!"),
                                      widget = poll_plugin_choices_widget,
                                      default = deferred_default_poll_method,)
                                      
    proposals = colander.SchemaNode(deform.Set(allow_empty=True), 
                                    name="proposals",
                                    title = _(u"Proposals"),
                                    description = _(u"poll_proposals_description",
                                                    default=u"Only proposals in the state 'published' can be selected"),
                                    missing=set(),
                                    widget=proposal_choices_widget,)
                                    
    add_reject_proposal = colander.SchemaNode(colander.Boolean(),
                                          title = _(u"Reject proposal"),
                                          description = _(u"add_reject_proposal_description",
                                                          default = u"Should a 'Reject all proposals' proposal be added to the poll?"),
                                          missing=False,
                                          widget=None)
                                          
    reject_proposal_title = colander.SchemaNode(colander.String(),
                                                title = _(u"Proposal text for 'reject all proposals'"),
                                                description = _(u"You can customise the proposal text if you want."),
                                                default = deferred_reject_proposal_title,
                                                widget = None)
    start_time = colander.SchemaNode(
         TZDateTime(),
         title = _(u"Start time of this poll."),
         description = _(u"You need to open it yourself."),
         widget=deform.widget.DateTimeInputWidget(options={'dateFormat': 'yy-mm-dd',
                                                           'timeFormat': 'hh:mm',
                                                           'separator': ' '}),
         default = deferred_default_start_time,
    )
    end_time = colander.SchemaNode(
         TZDateTime(),
         title = _(u"End time of this poll."),
         description = _(u"poll_end_time_description",
                         default = u"You need to close it yourself. A good default value is one day later."),
         widget=deform.widget.DateTimeInputWidget(options={'dateFormat': 'yy-mm-dd',
                                                           'timeFormat': 'hh:mm',
                                                           'separator': ' '}),
         default = deferred_default_end_time,
    )
Exemple #7
0
class ProfileSchema(CSRFSchema):
    """ This is the schema rendered out to the profile form, we define order
    since we are inheriting a few fields from pyramid_signup originally
    """
    username = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        missing=colander.null,
    )
    email = colander.SchemaNode(colander.String(), validator=colander.Email())
    first_name = colander.SchemaNode(
        colander.String(),
        default=profile_default,
    )
    last_name = colander.SchemaNode(colander.String(), default=profile_default)
    city = colander.SchemaNode(
        colander.String(),
        default=profile_default,
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        missing=None)
    state = colander.SchemaNode(
        colander.String(),
        default=profile_default,
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        missing=None)
    postal = colander.SchemaNode(
        colander.String(),
        default=profile_default,
    )
    country = colander.SchemaNode(
        colander.String(),
        #widget=country_widget,
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        default=country_default,
        missing=None)
    timezone = colander.SchemaNode(colander.String(),
                                   widget=timezone_widget,
                                   missing=None,
                                   default=timezone_default)
    spoken_Languages = colander.SchemaNode(deform.Set(),
                                           widget=language_widget,
                                           missing=None,
                                           default=language_default,
                                           title='Languages')
    # This is a 140 character one liner about themselves
    one_liner = colander.SchemaNode(colander.String(),
                                    title="Tagline",
                                    default=profile_default)
    description = colander.SchemaNode(colander.String(),
                                      missing=None,
                                      default=profile_default,
                                      widget=deform.widget.TextAreaWidget(
                                          rows=10, css_class="about-text"))
Exemple #8
0
class ImmediateAPConfigSchema(colander.Schema):
    immediate_access_grant_roles = colander.SchemaNode(
        deform.Set(),
        title=_(u"Roles"),
        description=_(
            u"immediate_ap_schema_grant_description",
            default=
            u"Users will be granted these roles IMMEDIATELY upon requesting access."
        ),
        default=(security.ROLE_VIEWER, ),
        widget=deform.widget.CheckboxChoiceWidget(
            values=security.STANDARD_ROLES, ),
    )
Exemple #9
0
class MeetingPollSettingsSchema(colander.MappingSchema):
    poll_plugins = colander.SchemaNode(
        deform.Set(allow_empty=True),
        title=_(u"mps_poll_plugins_title",
                default=u"Available poll methods within this meeting"),
        description=
        _(u"mps_poll_plugins_description",
          default=
          u"Only poll methods selected here will be available withing the meeting. "
          u"If nothing is selected, only the servers default poll method will be available."
          ),
        missing=set(),
        widget=poll_plugins_choices_widget,
    )
Exemple #10
0
class UserSchema(Schema):
    """ The property schema for :class:`substanced.principal.User`
    objects."""
    login = colander.SchemaNode(
        colander.String(),
        validator=login_validator,
    )
    email = colander.SchemaNode(
        colander.String(),
        validator=colander.All(colander.Email(), colander.Length(max=100)),
    )
    groups = colander.SchemaNode(
        deform.Set(allow_empty=True),
        widget=groups_widget,
        missing=colander.null,
        preparer=lambda groups: set(map(int, groups)),
    )
Exemple #11
0
class GroupSchema(Schema):
    """ The property schema for :class:`substanced.principal.Group`
    objects."""
    name = colander.SchemaNode(
        colander.String(),
        validator=groupname_validator,
    )
    description = colander.SchemaNode(
        colander.String(),
        validator=colander.Length(max=100),
        missing='',
    )
    members = colander.SchemaNode(
        deform.Set(allow_empty=True),
        widget=members_widget,
        missing=colander.null,
        preparer=lambda users: set(map(int, users)),
    )
class SinglePermissionSchema(colander.Schema):
    userid = colander.SchemaNode(
        colander.String(),
        title=_(u"UserID"),
        description=_(
            u"single_permission_schema_userid_description",
            default=
            u"Start typing the first letters of the UserID you want to add. You should see a popup below if that UserID exists."
        ),
        validator=deferred_existing_userid_validator,
        widget=deferred_autocompleting_userid_widget,
    )
    #It's called groups here, but we restrict choices to roles only
    groups = colander.SchemaNode(
        deform.Set(allow_empty=True),
        title=_(u"Groups"),
        widget=deferred_roles_widget,
        validator=deferred_context_roles_validator,
    )
class UserIDAndGroupsSchema(colander.Schema):
    userid = colander.SchemaNode(
        colander.String(),
        title=_(u"UserID"),
        validator=deferred_existing_userid_validator,
        widget=deferred_autocompleting_userid_widget,
    )
    name = colander.SchemaNode(
        colander.String(),
        title=_(u"Name"),
        widget=deform.widget.TextInputWidget(template='readonly/textinput'),
        missing=u"",
    )
    #It's called groups here, but we restrict choices to roles only
    groups = colander.SchemaNode(
        deform.Set(allow_empty=True),
        title=_(u"Groups"),
        widget=deferred_roles_widget,
        validator=deferred_context_roles_validator,
    )
Exemple #14
0
class AddTicketsSchema(colander.Schema):
    roles = colander.SchemaNode(
        deform.Set(),
        title=_(u"Roles"),
        default=(security.ROLE_DISCUSS, security.ROLE_PROPOSE,
                 security.ROLE_VOTER),
        description=_(
            u"add_tickets_roles_description",
            default=
            u"""One user can have more than one role. Note that to be able to propose,
                        discuss and vote you need respective role. This is selected by default. If you want
                        to add a user that can only view, select View and uncheck everything else."""
        ),
        widget=deform.widget.CheckboxChoiceWidget(
            values=security.MEETING_ROLES, ),
    )
    emails = colander.SchemaNode(
        colander.String(),
        title=_(u"add_tickets_emails_titles",
                default=u"Email addresses to give the roles above."),
        description=_(
            u"add_tickets_emails_description",
            default=u'Separate email addresses with a single line break.'),
        widget=deform.widget.TextAreaWidget(rows=7, cols=40),
        preparer=strip_and_lowercase,
        validator=colander.All(html_string_validator,
                               multiple_email_validator),
    )
    message = colander.SchemaNode(
        colander.String(),
        title=_(u"Welcome text of the email that will be sent"),
        description=
        _(u"ticket_message_description",
          default=
          u"The mail will contain instructions on how to access the meeting, "
          u"so focus on anything that might be specific for your participants."
          ),
        widget=deform.widget.TextAreaWidget(rows=5, cols=40),
        missing=u"",
        validator=html_string_validator,
    )
Exemple #15
0
    def get_schema_node(self):
        title = self.field.label
        list_type = self.field.get_option('list_type')
        new_option = self.field.get_option('new_option') == 'true'
        sort_choices = self.field.get_option('sort_choices')
        multiple_choice = self.field.get_option('multiple_choice') == 'true'
        valuesQuery = sas.query(ListOption) \
                .filter(ListOption.field_id == self.field.id) \
                .filter(ListOption.status != 'Rejected') \
                .filter(ListOption.status != 'Awaiting moderation')

        if sort_choices == 'user_defined':
            valuesObjs = valuesQuery.order_by(ListOption.position).all()
        elif sort_choices == 'random':
            valuesObjs = valuesQuery.all()
        elif sort_choices == 'alpha_asc':
            valuesObjs = valuesQuery.order_by(ListOption.label).all()
        elif sort_choices == 'alpha_desc':
            valuesObjs = valuesQuery.order_by(ListOption.label.desc()).all()

        values_tup = [(v.id, v.label) for v in valuesObjs]

        if sort_choices == 'random':
            random.shuffle(values_tup)

        values = tuple(values_tup)

        opt_restrictions = self.field.get_option('opt_restrictions')
        min_num = self.field.get_option('min_num')
        max_num = self.field.get_option('max_num')

        def valid_require(node, value):
            if self.field.get_option('new_option') == 'true':
                if self.field.required:
                    if list_type != 'radio':
                        if not value['option'].difference(set([''])) \
                                       and not value['other']:
                            raise c.Invalid(node, _('Required.'))
                    else:
                        if not value['option'] and not value['other']:
                            raise c.Invalid(node, _('Required.'))

            elif self.field.required:
                if list_type != 'radio':
                    if not value['option'].difference(set([''])):
                        raise c.Invalid(node, _('Required.'))
                elif not value['option']:
                    raise c.Invalid(node, _('Required.'))

        def min_choices(node, value):
            try:
                int(min_num)
            except ValueError:
                return

            if self.field.get_option('new_option') == 'true':
                add = 1 if value['other'] != '' else 0
            else:
                add = 0
            lacking_options = int(min_num) - \
                    len(value['option'].difference(set(['']))) + add
            if lacking_options > 0:
                if lacking_options == 1:
                    raise c.Invalid(node,
                            _('Please select one more option.'))
                else:
                    raise c.Invalid(node,
                            _('Please select {0} more options.'). \
                                    format(lacking_options))

        def max_choices(node, value):
            try:
                imax_num = int(max_num)
            except ValueError:
                return


            if self.field.get_option('new_option') == 'true':
                add = 1 if value['other'] != '' else 0
            else:
                add = 0
            excess_number = \
                    len(value['option'].difference(set(['']))) + \
                        add - imax_num
            if imax_num != 0 and excess_number > 0:
                if excess_number == 1:
                    raise c.Invalid(node,
                            _('Please deselect one option.'))
                else:
                    raise c.Invalid(node,
                            _('Please deselect {0} options.'). \
                                    format(excess_number))

        schema_params = {}
        if list_type == 'select' or list_type == 'checkbox':
            if opt_restrictions and multiple_choice:
                schema_params['validator'] = c.All(valid_require,
                                                min_choices, max_choices)
                schema_params['min_num'] = min_num
                schema_params['max_num'] = max_num
            else:
                schema_params['validator'] = valid_require
        else:
            schema_params['validator'] = valid_require

        if not self.field.required:
            schema_params['missing'] = {}
            schema_params['default'] = {}

        schema_params['multiple_choice'] = multiple_choice

        # Create the Mapping for select field
        list_map_schema = c.SchemaNode(c.Mapping(),
                title=title,
                name='input-{0}'.format(self.field.id),
                description=self.field.description,
                widget=d.widget.MappingWidget(template='form_select_mapping',
                                    item_template='form_select_mapping_item',
                                    error_class='error'),
                rich=self.field.rich,
                use_rich=self.field.use_rich,
                parent_id=self.field.id,
                opt_restrictions=self.field.get_option('opt_restrictions'),
                multiple=self.field.get_option('multiple_choice'),
                list_type=list_type,
                **schema_params)

        options = sas.query(ListOption) \
                .filter(ListOption.field_id == self.field.id) \
                .filter(ListOption.opt_default == True) \
                .all()

        options_id = [o.id for o in options]

        req_dict = {'missing': '', 'default': ''}

        if list_type == 'select':
            list_schema = c.SchemaNode(d.Set(allow_empty=True), title=title,
                    name='option',
                    widget=d.widget.SelectWidget(
                        values=values,
                        template='form_select'),
                    defaults=options_id,
                    req=self.field.required,
                    has_other=new_option,
                    description=self.field.description,
                    multiple=self.field.get_option('multiple_choice'),
                    size_options=self.field.get_option('size_options'),
                    parent_id=self.field.id,
                    **req_dict)

        elif list_type == 'radio':
            option = sas.query(ListOption) \
                    .filter(ListOption.field_id == self.field.id) \
                    .filter(ListOption.opt_default == True).first()

            if option:
                default_id = option.id
            else:
                default_id = ''

            list_schema = c.SchemaNode(c.Str(), title=title,
                        name='option',
                        widget=d.widget.RadioChoiceWidget(
                            template='form_radio_choice',
                            values=values),
                        description=self.field.description,
                        opt_default=default_id,
                        parent_id=self.field.id,
                        **req_dict)

        elif list_type == 'checkbox':
            def_options =  sas.query(ListOption) \
                    .filter(ListOption.field_id == self.field.id) \
                    .filter(ListOption.opt_default == True).all()

            list_schema = c.SchemaNode(d.Set(allow_empty=True), title=title,
                        name='option',
                        widget=d.widget.CheckboxChoiceWidget(values=values,
                            template='form_checkbox_choice'),
                        defaults=options_id,
                        description=self.field.description,
                        parent_id=self.field.id,
                        **req_dict)

        list_map_schema.add(list_schema)

        if self.field.get_option('new_option') == 'true':
            other_option_label = self.field.get_option('new_option_label')
            other_schema_args = dict( title=''
                                    , name='other'
                                    , default=''
                                    , missing=''
                                    , widget=d.widget.TextInputWidget(
                                                   template='form_other'
                                                 , category='structural')
                                    , other_label=other_option_label
                                    , list_type=list_type
                                    , parent_id=self.field.id)

            other_option = c.SchemaNode(c.Str(), **other_schema_args)
            list_map_schema.add(other_option)
        return list_map_schema
Exemple #16
0
    class DeclarationOfIntent(colander.MappingSchema):
        """
        colander schema for declaration of intent/ application form
        """
        type_of_creator = (('composer', _(u'composer')), ('lyricist',
                                                          _(u'lyricist')),
                           ('music producer', _(u'music producer')),
                           ('remixer', _(u'remixer')), ('dj', _(u'DJ')))

        activity = colander.SchemaNode(
            deform.Set(allow_empty=True),
            title=_(
                u"I'm musically involved in creating at least three songs, "
                "and I\'m considering to ask C3S to administer the rights "
                " to some of my songs. I am active as a "
                "(multiple selection possible)"),
            widget=deform.widget.CheckboxChoiceWidget(values=type_of_creator),
            missing=unicode(''))

        yes_no = ((u'yes', _(u'Yes')), (u'no', _(u'No')))

        #   at_least_three_works = colander.SchemaNode(
        #       colander.String(),
        #       title=_(u'I have been the (co-)creator of at least three titles '
        #               'in one of the functions mentioned under (1)'),
        #       validator=colander.OneOf([x[0] for x in yes_no]),
        #       widget=deform.widget.RadioChoiceWidget(values=yes_no))
        member_of_colsoc = colander.SchemaNode(
            colander.String(),
            title=_(
                u'Currently, I am a member of another collecting society.'),
            validator=colander.OneOf([x[0] for x in yes_no]),
            widget=deform.widget.RadioChoiceWidget(values=yes_no),
        )
        ## TODO: inColSocName if member_of_colsoc = yes
        name_of_colsoc = colander.SchemaNode(colander.String(),
                                             title=_(u'If so, which one?'),
                                             missing=unicode(''))
        invest_member = colander.SchemaNode(
            colander.String(),
            title=_(
                u'I am considering to join C3S as a supporting member only. '
                'This option is also available to members of other collecting '
                'societies without quitting those.'),
            validator=colander.OneOf([x[0] for x in yes_no]),
            widget=deform.widget.RadioChoiceWidget(values=yes_no))
        firstname = colander.SchemaNode(colander.String(),
                                        title=_(u"(Real) First Name"))
        lastname = colander.SchemaNode(colander.String(),
                                       title=_(u"(Real) Last Name"))
        email = colander.SchemaNode(colander.String(),
                                    title=_(u'Email'),
                                    validator=colander.Email())
        #  address1 = colander.SchemaNode(colander.String(),
        #                                 title=_(u'Street & No.'))
        #  address2 = colander.SchemaNode(colander.String(),
        #                                 missing=unicode(''),
        #                                 title=_(u"address cont'd"))
        #  postCode = colander.SchemaNode(colander.String(),
        #                                 title=_(u'Post Code'))
        city = colander.SchemaNode(colander.String(), title=_(u'City'))
        #  region = colander.SchemaNode(
        #      colander.String(),
        #      title=_(u'Federal State / Province / County'),
        #      missing=unicode(''))
        country = colander.SchemaNode(
            colander.String(),
            title=_(u'Country'),
            default=country_default,
            widget=deform.widget.SelectWidget(values=country_codes),
        )

        # TODO:
        # Date of birth (dd/mm/yyyy) (three fields)
        # size doesn't have any effect?!
        date_of_birth = colander.SchemaNode(
            colander.Date(),
            title=_(u'Date of Birth'),
            css_class="hasDatePicker",
            #widget = deform.widget.DatePWidget(),
            default=datetime.date(2013, 1, 1),
            validator=Range(
                min=datetime.date(1913, 1, 1),
                max=datetime.date(2000, 1, 1),
                min_err=_(u'${val} is earlier than earliest date ${min}'),
                max_err=_(u'${val} is later than latest date ${max}')))

        opt_band = colander.SchemaNode(colander.String(),
                                       title=_(u'optional: Band/Artist name'),
                                       missing=u'')

        opt_URL = colander.SchemaNode(colander.String(),
                                      title=_(u'optional: Homepage'),
                                      missing=u'')

        #print(country_codes())
        #understood_declaration = colander.SchemaNode(
        #colander.String(),
        #title=_(u'I have read and understood the text of the '
        #'declaration of intent.'),
        ##            validator=colander.OneOf(),
        #widget=deform.widget.CheckboxChoiceWidget(
        #values=(('yes', _(u'Yes')),)),
        #)
        #consider_joining = colander.SchemaNode(
        #colander.String(),
        #title=_(u'I seriously consider to join the C3S and want to '
        #'be notified via e-mail about its foundation.'),
        ##            validator=colander.OneOf([x[0] for x in yes_no]),
        #widget=deform.widget.CheckboxChoiceWidget(
        #values=(('yes', _(u'Yes')),)),
        #)
        noticed_dataProtection = colander.SchemaNode(
            colander.String(),
            title=_(u'I have taken note of the Data Protection Declaration '
                    'which is part of this text and can be read separately '
                    'at http://www.c3s.cc/disclaimer-en.html and agree with '
                    'it. I know that I may revoke this consent at any time.'),
            #            validator=colander.OneOf([x[0] for x in yes_no]),
            widget=deform.widget.CheckboxChoiceWidget(values=(('yes',
                                                               _(u'Yes')), )),
        )
        _LOCALE_ = colander.SchemaNode(colander.String(),
                                       widget=deform.widget.HiddenWidget(),
                                       default=locale_name)