Esempio n. 1
0
class IJoinSchema(Interface):

    """Schema for join form.
    """

    member_id = ASCIILine(
        title=_(u"Member ID"))

    email = EmailLine(
        title=_(u"Email Address"))

    password = Password(
        title=_(u"Password"),
        min_length=5)

    confirmation = Password(
        title=_(u"Password (confirm)"),
        min_length=5)

    send_password = Bool(
        title=_(u"Mail Password?"),
        description=_(u"Check this box to have the password mailed."))

    @invariant
    def check_passwords_match(schema):
        """Password and confirmation must match"""
        if schema.password != schema.confirmation:
            raise Invalid(_(u"Your password and confirmation did not match. "
                            u"Please try again."))
Esempio n. 2
0
class IEventSchema(Interface):

    """Schema for event views.
    """

    title = TextLine(
        title=_(u'Title'),
        required=False,
        missing_value=u'',
        max_length=100)

    contact_name = TextLine(
        title=_(u'Contact Name'),
        required=False,
        missing_value=u'',
        max_length=100)

    location = TextLine(
        title=_(u'Location'),
        required=False,
        missing_value=u'',
        max_length=100)

    contact_email = EmailLine(
        title=_(u'Contact Email'),
        required=False)

    categories = Set(
        title=_(u'Category'),
        required=False,
        missing_value=set(),
        value_type=Choice(vocabulary="cmf.calendar.AvailableEventTypes"))

    contact_phone = TextLine(
        title=_(u'Contact Phone'),
        required=False,
        missing_value=u'',
        max_length=100)

    event_url = URI(
        title=_(u'URL'),
        required=False,
        missing_value=u'',
        max_length=100)

    start_date = Datetime(
        title=_(u'From'),)

    stop_date = Datetime(
        title=_(u'To'),)

    description = Text(
        title=_(u'Description'),
        required=False,
        missing_value=u'')
Esempio n. 3
0
class ISendToManagerForm(Interface):
    """ Interface for describing the 'sendtomanager' form """

    send_from_address = EmailLine(
        title=_(u"label_send_from", default=u"From"),
        description=_(u"help_send_from", default=u"Your email address."),
        required=True,
    )

    comment = schema.Text(
        title=_(u"label_comment", default=u"Change request"),
        description=_(u"help_comment",
                      default=u"Report an error or missing information."),
        required=False,
    )

    captcha = schema.TextLine(title=u"ReCaptcha",
                              description=u"",
                              required=False)
class IPreferencesSchema(Interface):
    """Schema for member views.
    """

    fullname = TextLine(title=_(u'Full Name'),
                        description=_(u'given names and surname'),
                        required=False,
                        missing_value=u'')

    email = EmailLine(title=_(u'Email Address'),
                      description=_(u'*****@*****.**'))

    listed = Bool(
        title=_(u'Listed status'),
        description=_(u"Select to be listed on the public membership roster."))

    portal_skin = Choice(title=_(u'Skin'),
                         vocabulary=u"cmf.AvailableSkins",
                         required=False,
                         missing_value='')