示例#1
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'), [
        validators.Required(
            message=lazy_gettext("You must provide a description.")),
        validators.Length(max=255)
    ])
    short_name = TextField(label=None, widget=HiddenInput())
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = BooleanField(
        lazy_gettext('Allow Anonymous Contributors'))
    zip_download = BooleanField(lazy_gettext('Allow ZIP data download'))
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    email_notif = BooleanField(lazy_gettext('Email Notifications'))
    password = PasswordField(
        lazy_gettext('Password'), [
            validators.Optional(),
            pb_validator.CheckPasswordStrength(min_len=PROJECT_PWD_MIN_LEN,
                                               special=False)
        ],
        render_kw={
            'placeholder':
            'Minimum length {} characters, 1 uppercase, 1 lowercase and 1 numeric.'
            .format(PROJECT_PWD_MIN_LEN)
        })
    webhook = TextField(lazy_gettext('Webhook'), [pb_validator.Webhook()])
    sync_enabled = BooleanField(lazy_gettext('Enable Project Syncing'))
示例#2
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'), [
        validators.Required(
            message=lazy_gettext("You must provide a description.")),
        validators.Length(max=255)
    ])
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = BooleanField(
        lazy_gettext('Allow Anonymous Contributors'))
    zip_download = BooleanField(lazy_gettext('Allow ZIP data download'))
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    email_notif = BooleanField(lazy_gettext('Email Notifications'))
    password = TextField(lazy_gettext('Password'), [
        validators.Optional(),
        pb_validator.CheckPasswordStrength(min_len=PROJECT_PWD_MIN_LEN,
                                           special=False)
    ])
    if data_access.data_access_levels:
        data_access = Select2Field(
            lazy_gettext('Access Level(s)'), [validators.Required()],
            choices=data_access.data_access_levels['valid_access_levels'],
            default=[])
    webhook = TextField(lazy_gettext('Webhook'), [pb_validator.Webhook()])
    sync_enabled = BooleanField(lazy_gettext('Enable Project Syncing'))
示例#3
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'), [
        validators.Required(
            message=lazy_gettext("You must provide a description.")),
        validators.Length(max=255)
    ])
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = BooleanField(
        lazy_gettext('Allow Anonymous Contributors'))
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    protect = BooleanField(lazy_gettext('Protect with a password?'))
    password = TextField(lazy_gettext('Password'))
    webhook = TextField(lazy_gettext('Webhook'), [pb_validator.Webhook()])
示例#4
0
文件: forms.py 项目: ianthe/pybossa
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'), [
        validators.Required(
            message=lazy_gettext("You must provide a description.")),
        validators.Length(max=255)
    ])
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = SelectField(
        lazy_gettext('Allow Anonymous Contributors'),
        choices=[('True', lazy_gettext('Yes')), ('False', lazy_gettext('No'))])
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    password = TextField(
        lazy_gettext('Password (leave blank for no password)'))
    webhook = TextField(lazy_gettext('Webhook'), [pb_validator.Webhook()])
示例#5
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'),
                            [validators.Required(
                                message=lazy_gettext(
                                    "You must provide a description.")),
                             validators.Length(max=255)])
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = SelectField(
        lazy_gettext('Allow Anonymous Contributors'),
        choices=[('True', lazy_gettext('Yes')),
                 ('False', lazy_gettext('No'))])
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    password = TextField(lazy_gettext('Password (leave blank for no password)'))
    webhook = TextField(lazy_gettext('Webhook'),
                        [pb_validator.Webhook()])
    calibration_frac = DecimalField(lazy_gettext('Acceptable percentage of consensus'),
                              [validators.NumberRange(
                                  min=60, max=100,
                                  message=lazy_gettext('Consensus should be \
                                                        between 60.0 and 100.0'))])
示例#6
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'), [
        validators.Required(
            message=lazy_gettext("You must provide a description.")),
        validators.Length(max=255)
    ])
    short_name = TextField(label=None, widget=HiddenInput())
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = BooleanField(
        lazy_gettext('Allow Anonymous Contributors'))
    zip_download = BooleanField(lazy_gettext('Allow ZIP data download'))
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    email_notif = BooleanField(lazy_gettext('Email Notifications'))
    password = TextField(lazy_gettext('Password'), [
        validators.Optional(),
        pb_validator.CheckPasswordStrength(min_len=PROJECT_PWD_MIN_LEN,
                                           special=False)
    ])
    webhook = TextField(lazy_gettext('Webhook'), [pb_validator.Webhook()])
    sync_enabled = BooleanField(lazy_gettext('Enable Project Syncing'))
    dataset_description = TextAreaField(lazy_gettext('Dataset Description'))
    provider = SelectField(lazy_gettext('Annotation Provider'),
                           choices=[(None, "NONE")] + [(x, x) for x in [
                               "PERSONNEL", "VENDOR", "CONTINGENT_WORKER",
                               "FREELANCER", "CROWDSOURCING_WORKER"
                           ]],
                           coerce=lambda x: None if x == "None" else x)
    restrictions_and_permissioning = TextAreaField(
        lazy_gettext('Restrictions & Permissioning'))
    store_pvf = TextField(lazy_gettext('Annotation Store PVF'))
    sampling_method = TextField(lazy_gettext('Sampling Method'))
    sampling_script = TextField(lazy_gettext('Sampling Script Link'))
    label_aggregation_strategy = TextField(
        lazy_gettext('Label Aggregation Strategy'))
    task_input_schema = TextAreaField(lazy_gettext('Task Input Schema'))
    task_output_schema = TextAreaField(lazy_gettext('Task Output Schema'))
示例#7
0
class ProjectUpdateForm(ProjectForm):
    id = IntegerField(label=None, widget=HiddenInput())
    description = TextAreaField(lazy_gettext('Description'),
                            [validators.Required(
                                message=lazy_gettext(
                                    "You must provide a description.")),
                             validators.Length(max=255)])
    long_description = TextAreaField(lazy_gettext('Long Description'))
    allow_anonymous_contributors = BooleanField(lazy_gettext('Allow Anonymous Contributors'))
    category_id = SelectField(lazy_gettext('Category'), coerce=int)
    hidden = BooleanField(lazy_gettext('Hide?'))
    email_notif = BooleanField(lazy_gettext('Email Notifications'))
    password = TextField(
                    lazy_gettext('Password'),
                    [validators.Optional(),
                        pb_validator.CheckPasswordStrength(
                                        min_len=PROJECT_PWD_MIN_LEN,
                                        special=False)])
    webhook = TextField(lazy_gettext('Webhook'),
                        [pb_validator.Webhook()])
    sync_target_url = TextField(lazy_gettext('Target URL'))
    sync_target_key = TextField(lazy_gettext('API Key'))
    sync_enabled = BooleanField(lazy_gettext('Enable Project Syncing'))