Пример #1
0
class ManEdBulkEditJournalForm(Form):
    publisher = StringField('Publisher', [validators.Optional()])
    doaj_seal = DOAJSelectField(
        'Qualifies for Seal',
        [validators.Optional()],
        description='How should we change the DOAJ Seal on these journals?',
        choices=[("", "Leave unchanged"), ("True", "Yes"), ("False", "No")],
    )
    country = DOAJSelectField(
        'Country',
        [validators.Optional()],
        description=
        'Select the country where the publisher carries out its business activities.',
        choices=Choices.country(),
    )
    owner = StringField(
        'Owner',
        [ReservedUsernames(), validators.Optional()],
        description='DOAJ account to which the application belongs.')
    platform = StringField(
        'Platform, Host or Aggregator', [validators.Optional()],
        description=
        'The name of the platform, host or aggregator of the journal content, e.g. OJS, HighWire Press, EBSCO etc.'
    )
    contact_name = StringField('Contact Name', [validators.Optional()])
    contact_email = StringField('Contact\'s email address', [
        validators.Optional(),
        validators.Email(message='Invalid email address.')
    ])
Пример #2
0
class ApplicationOwner(Form):
    """ An Owner field which is optional under certain conditions.  For use in some admin forms """

    owner = StringField('Owner',
        [ReservedUsernames(), OptionalIf('application_status', optvals=Choices.application_status_optional())],
        description='DOAJ account to which the application belongs.'
                    '<br><br>'
                    'This field is optional unless the application status is set to Accepted.'
                    '<br><br>'
                    'Entering a non-existent account and setting the application status to Accepted will automatically create the account using the Contact information in Questions 9 & 10, and send an email containing the Contact\'s username + password.'
    )
Пример #3
0
class RegisterForm(Form):
    w = StringField('Username', [ReservedUsernames(), validators.Length(min=3, max=25), existscheck])
    n = StringField('Email Address', [
        validators.Length(min=3, max=254),
        validators.Email(message='Must be a valid email address')
    ])
    s = PasswordField('Password', [
        validators.DataRequired(),
        validators.EqualTo('c', message='Passwords must match')
    ])
    c = PasswordField('Repeat Password')
    roles = StringField('Roles')
Пример #4
0
 def __init__(self, **kwargs):
     from portality.formcontext.validate import ReservedUsernames
     ReservedUsernames().validate(kwargs.get('id', ''))
     super(Account, self).__init__(**kwargs)
Пример #5
0
class RequiredOwner(Form):
    """ An Owner field which is required - validation will fail if it is not provided.  For use in some admin forms """

    owner = StringField('Owner',
                        [validators.DataRequired(),
                         ReservedUsernames()])