Example #1
0
class ListingForms(Form):
    location = SelectField(validators=[DataRequired()], choices=[], id="list-location")
    price_type_id = SelectField(
        validators=[DataRequired()], choices=[], coerce=int, id="list-package"
    )
    package = SelectField(
        validators=[DataRequired()],
        choices=[("Budget", "Budget"), ("Luxury", "Luxury")],
    )
    duration = StringField("duration", validators=[Length(min=2, max=80)])
    availability_from = DateField("availability_from", format="%d/%m/%Y")
    availability_to = DateField("availability_to", format="%d/%m/%Y")
    categories = SelectMultipleField(
        validators=[DataRequired()], choices=[], coerce=int
    )
    long_description = TextAreaField(
        "long description", validators=[Length(min=20, max=2000)]
    )
    activities = FieldList(FormField(ActivityForm), min_entries=1)
    places = FieldList(FormField(PlaceForm), min_entries=1)
    days = FieldList(FormField(DayForm), min_entries=1)
    images = FieldList(FormField(ImageForm), min_entries=1)
    physical_condition = StringField(
        "physical condition", validators=[Length(min=2, max=80)]
    )
    connectivity = StringField("Connectivity", validators=[Length(min=2, max=80)])
    add_ons = TextAreaField("long description", validators=[Length(min=0, max=2000)])
    policy = TextAreaField("policy", validators=[Length(min=2, max=2000)])
    submit = SubmitField("save")
Example #2
0
class ActionForm(FlaskForm):
    """Action Form"""

    action_name = StringField(
        "Name",
        validators=[DataRequired(), Length(max=32)],
        render_kw={"class": "form-control"},
    )
    action_type = SelectField(
        "Type",
        validators=[DataRequired()],
        default="Notification",
        choices=[(item.name, item.value) for item in ActionType],
        render_kw={"class": "form-control"},
    )
    channel_id = HiddenField("Channel ID")
    tag = HiddenField("Tag")
    notification = FormField(NotificationActionForm)
    playlist = FormField(PlaylistActionForm)
    download = FormField(DownloadActionForm)

    def validate(self):
        if not self.channel_id.data and not self.tag.data:
            return False
        if self.action_type.data == "Notification" and not self.notification.validate(
                self):
            return False
        if self.action_type.data == "Playlist" and not self.playlist.validate(
                self):
            return False
        if self.action_type.data == "Download" and not self.download.validate(
                self):
            return False
        return True
Example #3
0
class PolicyForm(BaseForm):
    name = StringField(l_('Name'), validators=[InputRequired])
    description = StringField(l_('Description'))
    acl_templates = FieldList(FormField(AclTemplatesForm))
    tenant_uuid = SelectField(l_('Tenant'), choices=[])
    tenant = FormField(TenantUuidForm)
    submit = SubmitField()
class GroupForm(BaseForm):
    name = StringField(l_('Name'), [InputRequired(), Length(max=128)])
    extensions = FieldList(FormField(ExtensionForm), min_entries=1)
    caller_id_mode = SelectField(l_('Callerid mode'),
                                 choices=[('', l_('None')),
                                          ('prepend', l_('Prepend')),
                                          ('overwrite', l_('Overwrite')),
                                          ('append', l_('Append'))])
    caller_id_name = StringField('Callerid name', [Length(max=80)])
    enabled = BooleanField(l_('Enabled'))
    music_on_hold = SelectField('Music On Hold', [Length(max=128)], choices=[])
    preprocess_subroutine = StringField(l_('Subroutine'), [Length(max=39)])
    retry_delay = IntegerField('Retry delay', [NumberRange(min=0)])
    ring_in_use = BooleanField('Ring in use')
    ring_strategy = SelectField('Ring strategy',
                                choices=[('all', l_('All')),
                                         ('random', l_('Random')),
                                         ('least_recent', l_('Least recent')),
                                         ('linear', l_('Linear')),
                                         ('fewest_calls', l_('Fewest calls')),
                                         ('memorized_round_robin',
                                          l_('Memorized round robin')),
                                         ('weight_random', l_('Weight random'))
                                         ])
    timeout = IntegerField(l_('Timeout'), [NumberRange(min=0)])
    user_timeout = IntegerField(l_('User timeout'), [NumberRange(min=0)])
    members = FormField(MembersForm)
    fallbacks = FormField(FallbacksForm)
    schedules = FieldList(FormField(ScheduleForm), min_entries=1)
    call_permission_ids = SelectMultipleField(l_('Call Permissions'),
                                              choices=[])
    call_permissions = FieldList(FormField(CallPermissionForm))
    submit = SubmitField(l_('Submit'))
Example #5
0
class ExternalAuthForm(BaseForm):
    type = HiddenField()
    editing = HiddenField()
    microsoft_config = FormField(MicrosoftForm)
    google_config = FormField(GoogleForm)
    mobile_config = FormField(MobileForm)
    submit = SubmitField()
Example #6
0
class ProfileForm(Form):
    company_name = StringField("name", validators=[Length(min=2, max=100)])
    physical_address = StringField(validators=[Length(min=1, max=100)])
    postal_address = StringField(validators=[Length(min=1, max=100)])
    association_membership = StringField(validators=[Length(min=0, max=100)])
    bank_name = StringField(validators=[Length(min=0, max=100)])
    bank_account = StringField(validators=[Length(min=0, max=100)])
    swift_code = StringField(validators=[Length(min=0, max=100)])
    director = StringField(validators=[Length(min=0, max=100)])
    director_phone = StringField(validators=[Length(min=0, max=100)])
    director_email = StringField(validators=[Length(min=0, max=100)])
    overview = TextAreaField(validators=[Length(min=2, max=2000)])
    phones = FieldList(FormField(PhoneForm), min_entries=1)
    emails = FieldList(FormField(EmailForm), min_entries=1)
    locations = FieldList(FormField(LocationForm), min_entries=1)
    terms_of_use = BooleanField(validators=[DataRequired()], id="terms_of_use")
    operator_licence = FileField(
        validators=[
            FileAllowed(photos, u"Image Only!"),
            FileRequired(u"Choose a file!"),
        ]
    )
    reg_certificate = FileField(
        validators=[
            FileAllowed(photos, u"Image Only!"),
            FileRequired(u"Choose a file!"),
        ]
    )
    tax_registration = FileField(
        validators=[
            FileAllowed(photos, u"Image Only!"),
            FileRequired(u"Choose a file!"),
        ]
    )
Example #7
0
class LineForm(BaseForm):
    context = SelectField(l_('Context'), choices=[])
    protocol = SelectField(choices=[('sip', l_('SIP')), ('custom',
                                                         l_('CUSTOM'))])
    endpoint_sip = FormField(EnpointSipForm)
    endpoint_custom = FormField(EnpointCustomForm)
    submit = SubmitField(l_('Submit'))
Example #8
0
def filter_members():
    class F(FlaskForm):
        pass

    TagColForm = forms.TagForm.tag_form(Tag.query.all())
    TagRowForm = forms.TagForm.tag_form(Tag.query.all())

    F.col_form = FormField(TagColForm)
    F.row_form = FormField(TagRowForm)
    F.only_active = BooleanField('Only active members', default=True)

    form = F()

    if form.validate_on_submit():
        if form.col_form.checked_tags():
            if form.only_active.data:
                mandatory = ['Aktiv']
            else:
                mandatory = None

            if form.row_form.checked_tags():
                return redirect(
                    url_for('.member_matrix',
                            columns=form.col_form.checked_tags(),
                            rows=form.row_form.checked_tags(),
                            mandatory=mandatory))

            return redirect(
                url_for('.members_by_tags',
                        tag_list=form.col_form.checked_tags(),
                        mandatory=mandatory))
        else:
            flash("Please enter which tags to display (in columns)", 'error')

    return render_template('members/filter_members.html', form=form)
Example #9
0
class UserForm(BaseForm):
    firstname = StringField(l_('Firstname'), [InputRequired(), Length(max=128)])
    lastname = StringField(l_('Lastname'), [Length(max=128)])
    username = StringField(l_('Username'), [InputRequired(), Length(min=2, max=254)])
    password = StringField(l_('Password'), [Length(min=4, max=64)])
    email = EmailField(l_('Email'), [Length(max=254)])
    caller_id = StringField(l_('Caller ID'), [Length(max=80)])
    mobile_phone_number = StringField(l_('Phone mobile'), [Length(max=80)])
    ring_seconds = IntegerField(l_('Ring seconds'), [NumberRange(min=0, max=60)])
    music_on_hold = SelectField(l_('Music On Hold'), choices=[])
    preprocess_subroutine = StringField(l_('Subroutine'), [Length(max=39)])
    simultaneous_calls = IntegerField(l_('Simultaneous calls'), [NumberRange(min=1, max=20)])
    timezone = StringField(l_('Timezone'), [Length(max=254)])
    userfield = StringField(l_('User Field'), [Length(max=128)])
    description = StringField(l_('Description'))
    fallbacks = FormField(FallbacksForm)
    forwards = FormField(UserForwardForm)
    services = FormField(UserServiceForm)
    lines = FieldList(FormField(LineForm))
    cti_profile = FormField(CtiProfileForm)
    group_ids = SelectMultipleField(l_('Groups'), choices=[])
    groups = FieldList(FormField(GroupForm))
    funckeys = FieldList(FormField(FuncKeyTemplateKeysForm))
    schedules = FieldList(FormField(ScheduleForm), min_entries=1)
    voicemail = FormField(VoicemailForm)
    call_permission_ids = SelectMultipleField(l_('Call Permissions'), choices=[])
    call_permissions = FieldList(FormField(CallPermissionForm))
    submit = SubmitField(l_('Submit'))
Example #10
0
class CourseForm(Form):

    priority=RadioField("Priority",choices=[("1","Emerging and neglected human, animal and plant diseases"),("2","Environmental microbiology: Metagenomics as a bioprospection tool for bioremediation"),\
    ("3","Renewable sources of energy (industrial biotechnology)")])
    courseTitle = StringField(u'Text')
    hostName = StringField(u'Text')
    hostAddress = StringField(u'Text')
    coordName = StringField(u'Text')
    coordTitle = StringField(u'Text')
    coordAffiliation = StringField(u'Text')
    #Pilas aqui con el formato, porque en HTML es mm-dd-yy (YO copie tu implementacion en Register_form)
    commDate=DateField("Expected Commencement Date (YY-MM-DD)",\
  [InputRequired("Please specify an Expected Commencement Date for your Training Course")],\
  format="%Y-%m-%d")
    termDate=DateField("Expected Termination Date (YY-MM-DD)",\
  [InputRequired("Please specify an Expected Termination Date for your Training Course")],\
  format="%Y-%m-%d")
    destination = StringField(u'Text')
    courseObjectives = FieldList(
        FormField(ObjectiveForm, default=lambda: CourseObjectives()))
    courseDescription = StringField(u'Text', widget=TextArea())
    organizationTrainingDescription = StringField(u'Text', widget=TextArea())
    courseCollaborators = FieldList(
        FormField(CollaboratorForm, default=lambda: CourseCollaborators()))
    expectedOutput = StringField(u'Text', widget=TextArea())
    courseTrainees = StringField(u'Text', widget=TextArea())
    courseBudgetItems = FieldList(
        FormField(BudgetForm, default=lambda: CourseBudgetsItems()))
    submit = SubmitField('Submit')
    fundingSource = StringField(u'Text')
    fundingSourceScore = IntegerField(u'Text')  #numerico
    counterpartFund = StringField(u'Text')
    counterpartFundScore = IntegerField(u'Text')  #numerico
class ScheduleForm(BaseForm):
    name = StringField(l_('Name'), validators=[InputRequired()])
    timezone = SelectField(l_('Timezone'), choices=list_timezones())
    closed_destination = DestinationField()
    exceptional_periods = FieldList(FormField(ScheduleExceptionalPeriodForm))
    open_periods = FieldList(FormField(ScheduleOpenPeriodForm))
    submit = SubmitField(l_('Submit'))
Example #12
0
class JobForm(FlaskForm):
    base_args = FormField(JobBaseForm)
    cron_trigger_args = FormField(CronForm)
    date_trigger_args = FormField(DateForm)
    interval_trigger_args = FormField(IntervalForm)
    type = HiddenField("Type")
    submit = SubmitField("Apply")

    def validate(self):
        current_app.logger.info("----------BEGIN FORM VALIDATE----------")
        results = True
        if not FlaskForm.validate(self.base_args.form):
            current_app.logger.info("Base Form Not Validate")
            results = False
        if self.base_args.trigger.data == "cron" and not self.cron_trigger_args.validate(
                self):
            current_app.logger.info("Cron Form Not Validate")
            results = False
        if self.base_args.trigger.data == "date" and not self.date_trigger_args.validate(
                self):
            current_app.logger.info("Date Form Not Validate")
            results = False
        if self.base_args.trigger.data == "interval" and not self.interval_trigger_args.validate(
                self):
            current_app.logger.info("Interval Form Not Validate")
            results = False
        current_app.logger.info("Final Results: {}".format(results))
        current_app.logger.info("----------END FORM VALIDATE----------")
        return results
Example #13
0
class MembersForm(BaseForm):
    user_uuids = SelectMultipleField(l_('Members'), choices=[])
    users = FieldList(FormField(UserUuidForm))
    group_uuids = SelectMultipleField(l_('Groups'), choices=[])
    groups = FieldList(FormField(GroupUuidForm))
    policy_uuids = SelectMultipleField(l_('Policies'), choices=[])
    policies = FieldList(FormField(PolicyUuidForm))
Example #14
0
class StreamForm(FlaskForm):
    name = StringField(lazy_gettext(u'Name:'),
                       validators=[InputRequired(), Length(min=MIN_STREAM_NAME_LENGTH, max=MAX_STREAM_NAME_LENGTH)])
    input = FormField(UrlsForm, lazy_gettext(u'Input:'))
    output = FormField(UrlsForm, lazy_gettext(u'Output:'))
    log_level = SelectField(lazy_gettext(u'Log level:'), validators=[],
                            choices=constants.AVAILABLE_LOG_LEVELS_PAIRS, coerce=constants.StreamLogLevel.coerce)
    audio_select = IntegerField(lazy_gettext(u'Audio select:'),
                                validators=[InputRequired(), NumberRange(constants.INVALID_AUDIO_SELECT, 1000)])
    have_video = BooleanField(lazy_gettext(u'Have video:'), validators=[])
    have_audio = BooleanField(lazy_gettext(u'Have audio:'), validators=[])
    loop = BooleanField(lazy_gettext(u'Loop:'), validators=[])
    restart_attempts = IntegerField(lazy_gettext(u'Max restart attempts and frozen:'),
                                    validators=[NumberRange(1, 1000)])
    auto_exit_time = IntegerField(lazy_gettext(u'Auto exit time:'), validators=[])
    submit = SubmitField(lazy_gettext(u'Confirm'))

    def make_entry(self):
        return self.update_entry(Stream())

    def update_entry(self, entry: Stream):
        entry.name = self.name.data
        entry.input = self.input.get_data()
        entry.output = self.output.get_data()

        entry.audio_select = self.audio_select.data
        entry.have_video = self.have_video.data
        entry.have_audio = self.have_audio.data
        entry.log_level = self.log_level.data
        entry.loop = self.loop.data
        entry.restart_attempts = self.restart_attempts.data
        entry.auto_exit_time = self.auto_exit_time.data
        return entry
Example #15
0
 class OptimisationForm(FlaskForm):
     """Main form for setting up an optimisation."""
     opt_form = FormField(make_optimiser_form(optimiser), label='Optimiser')
     sequence_form = FormField(make_sequence_form(optimiser),
                               label='Process sequence')
     steps_form = FormField(make_steps_forms(steps),
                            label='Unit operations')
     name_field = StringField('Name', [Length(max=50)])
Example #16
0
class CsvForm(BaseForm):
    first_matched_columns = FieldList(FormField(ColumnsForm))
    format_columns = FieldList(FormField(ValueColumnsForm))
    searched_columns = FieldList(FormField(ColumnsForm))
    # `separator` can't be used an a field for wtforms ...
    delimiter = StringField(l_('Delimiter'))
    file = StringField(l_('File'), validators=[InputRequired()])
    unique_column = StringField(l_('Unique column'))
Example #17
0
class CallPickupForm(BaseForm):
    name = StringField(l_('Name'),
                       validators=[InputRequired(),
                                   Length(max=128)])
    interceptors = FormField(InterceptorsForm)
    targets = FormField(TargetsForm)
    description = StringField(l_('Description'))
    enabled = BooleanField(l_('Enabled'))
    submit = SubmitField(l_('Submit'))
Example #18
0
class TaskOrderForm(BaseForm):
    number = StringField(
        label=translate("forms.task_order.number_description"))
    pdf = FormField(
        AttachmentForm,
        label=translate("task_orders.form.supporting_docs_size_limit"),
        description=translate("task_orders.form.supporting_docs_size_limit"),
    )
    clins = FieldList(FormField(CLINForm))
Example #19
0
class HangupDestination(BaseDestinationForm):
    select_field = 'cause'

    cause = SelectField(l_('Cause'), choices=[('normal', l_('Normal')),
                                              ('busy', l_('Busy')),
                                              ('congestion', l_('Congestion'))])
    busy = FormField(HangupBusyDestination)
    congestion = FormField(HangupBusyDestination)
    normal = FormField(HangupNormalDestination)
Example #20
0
class TrunkForm(BaseForm):
    context = SelectField(l_('Context'), choices=[])
    protocol = SelectField(choices=[('sip', l_('SIP')), ('iax', l_('IAX')), ('custom', l_('CUSTOM'))])
    endpoint_sip = FormField(EnpointSipForm)
    endpoint_iax = FormField(EnpointIaxForm)
    endpoint_custom = FormField(EnpointCustomForm)
    register_sip = FormField(RegisterSIPForm)
    register_iax = FormField(RegisterIAXForm)
    submit = SubmitField(l_('Submit'))
class OdooForm(BaseForm):
    first_matched_columns = FieldList(FormField(ColumnsForm))
    format_columns = FieldList(FormField(ValueColumnsForm))
    searched_columns = FieldList(FormField(ColumnsForm))
    server = StringField(l_('Server'))
    port = StringField(l_('Port'))
    userid = StringField(l_('UserID'))
    password = StringField(l_('Password'))
    database = StringField(l_('Database'))
Example #22
0
class TargetsForm(BaseForm):
    user_uuids = SelectMultipleField(l_('Target Users'),
                                     choices=[],
                                     default=[])
    users = FieldList(FormField(UserForm))
    group_ids = SelectMultipleField(l_('Target Groups'),
                                    choices=[],
                                    default=[])
    groups = FieldList(FormField(GroupForm))
Example #23
0
class EncodeStreamForm(HardwareStreamForm):
    relay_video = BooleanField('Relay video:', validators=[])
    relay_audio = BooleanField('Relay audio:', validators=[])
    deinterlace = BooleanField('Deinterlace:', validators=[])
    frame_rate = IntegerField('Frame rate:',
                              validators=[
                                  InputRequired(),
                                  NumberRange(constants.INVALID_FRAME_RATE,
                                              constants.MAX_FRAME_RATE)
                              ])
    volume = FloatField('Volume:',
                        validators=[
                            InputRequired(),
                            NumberRange(constants.MIN_VOLUME,
                                        constants.MAX_VOLUME)
                        ])
    video_codec = SelectField('Video codec:',
                              validators=[],
                              choices=constants.AVAILABLE_VIDEO_CODECS)
    audio_codec = SelectField('Audio codec:',
                              validators=[],
                              choices=constants.AVAILABLE_AUDIO_CODECS)
    audio_channels_count = IntegerField(
        'Audio channels count:',
        validators=[
            InputRequired(),
            NumberRange(constants.INVALID_AUDIO_CHANNELS_COUNT,
                        constants.MAX_AUDIO_CHANNELS_COUNT)
        ])
    size = FormField(SizeForm, 'Size:', validators=[])
    video_bit_rate = IntegerField('Video bit rate:',
                                  validators=[InputRequired()])
    audio_bit_rate = IntegerField('Audio bit rate:',
                                  validators=[InputRequired()])
    logo = FormField(LogoForm, 'Logo:', validators=[])
    rsvg_logo = FormField(RSVGLogoForm, 'RSVG Logo:', validators=[])
    aspect_ratio = FormField(RationalForm, 'Aspect ratio:', validators=[])

    def make_entry(self):
        return self.update_entry(EncodeStream())

    def update_entry(self, entry: EncodeStream):
        entry.relay_video = self.relay_video.data
        entry.relay_audio = self.relay_audio.data
        entry.deinterlace = self.deinterlace.data
        entry.frame_rate = self.frame_rate.data
        entry.volume = self.volume.data
        entry.video_codec = self.video_codec.data
        entry.audio_codec = self.audio_codec.data
        entry.audio_channels_count = self.audio_channels_count.data
        entry.size = self.size.get_data()
        entry.video_bit_rate = self.video_bit_rate.data
        entry.audio_bit_rate = self.audio_bit_rate.data
        entry.logo = self.logo.get_data()
        entry.rsvg_logo = self.rsvg_logo.get_data()
        entry.aspect_ratio = self.aspect_ratio.get_data()
        return super(EncodeStreamForm, self).update_entry(entry)
Example #24
0
class DeployForm(FlaskForm):
    name = StringField('App Name', validators=[InputRequired(), validate_name])
    image = StringField('Image', validators=[InputRequired()])
    ports = FieldList(FormField(_PortForm))
    volumes = FieldList(FormField(_VolumeForm))
    env = FieldList(FormField(_EnvForm))
    sysctls = FieldList(FormField(_SysctlsForm), min_entries=1)
    restart_policy = StringField('Restart Policy')
    submit = SubmitField('Deploy App')
Example #25
0
class LineForm(BaseForm):
    context = SelectField(l_('Context'),
                          validators=[InputRequired()],
                          choices=[])
    protocol = SelectField(choices=[('sip', l_('SIP')), ('custom',
                                                         l_('CUSTOM'))])
    endpoint_sip = FormField(EndpointSIPForm)
    endpoint_custom = FormField(EndpointCustomForm)
    submit = SubmitField(l_('Submit'))
Example #26
0
class InterceptorsForm(BaseForm):
    user_uuids = SelectMultipleField(l_('Interceptor Users'),
                                     choices=[],
                                     default=[])
    users = FieldList(FormField(UserForm))
    group_ids = SelectMultipleField(l_('Interceptor Groups'),
                                    choices=[],
                                    default=[])
    groups = FieldList(FormField(GroupForm))
Example #27
0
class QueueForm(BaseForm):
    name = StringField(l_('Name'), [InputRequired(), Length(max=128)])
    label = StringField(l_('Label'), [InputRequired(), Length(max=128)])

    announce_hold_time_on_entry = BooleanField(
        l_('Announce hold time on entry'), default=False)
    music_on_hold = SelectField(l_('Music On Hold'), [Length(max=128)],
                                choices=[])
    data_quality = BooleanField(l_('Data quality'), default=False)
    caller_id_mode = SelectField(l_('Caller ID mode'),
                                 choices=[('', l_('None')),
                                          ('prepend', l_('Prepend')),
                                          ('overwrite', l_('Overwrite')),
                                          ('append', l_('Append'))])
    caller_id_name = StringField(l_('Caller ID name'), [Length(max=80)])

    dtmf_hangup_callee_enabled = BooleanField(l_('DTMF hangup callee enabled'),
                                              default=False)
    dtmf_hangup_caller_enabled = BooleanField(l_('DTMF hangup caller enabled'),
                                              default=False)
    dtmf_record_callee_enabled = BooleanField(l_('DTMF record callee enabled'),
                                              default=False)
    dtmf_record_caller_enabled = BooleanField(l_('DTMF record caller enabled'),
                                              default=False)
    dtmf_transfer_callee_enabled = BooleanField(
        l_('DTMF transfer callee enabled'), default=False)
    dtmf_transfer_caller_enabled = BooleanField(
        l_('DTMF transfer caller enabled'), default=False)

    ignore_forward = BooleanField(l_('Ignore forward'), default=False)
    preprocess_subroutine = StringField(l_('Subroutine'), [Length(max=39)])
    retry_on_timeout = BooleanField(l_('Retry on timeout'), default=False)
    ring_on_hold = BooleanField(l_('Ring on hold'), default=False)
    timeout = IntegerField(l_('Timeout'), [NumberRange(min=0)])

    wait_ratio_destination = DestinationField(
        destination_label=l_('Wait ratio destination'))
    wait_ratio_threshold = FloatField(l_('Wait ratio threshold'),
                                      [NumberRange(min=0)])
    wait_time_destination = DestinationField(
        destination_label=l_('Wait time destination'))
    wait_time_threshold = IntegerField(l_('Wait time threshold'),
                                       [NumberRange(min=0)])

    extensions = FieldList(FormField(ExtensionForm), min_entries=1)
    fallbacks = FormField(FallbacksForm)
    schedules = FieldList(FormField(ScheduleForm), min_entries=1)
    options = FieldList(FormField(OptionsForm))

    enabled = BooleanField(l_('Enabled'), default=False)
    members = FormField(MembersForm)
    mark_answered_elsewhere = BooleanField(
        l_('Mark all calls as answered elsewhere when cancelled'),
        default=False)

    submit = SubmitField(l_('Submit'))
Example #28
0
class ExtrasForm(Form):
    long_description = TextAreaField(
        "long description", validators=[Length(min=20, max=2000)]
    )
    activities = FieldList(
        FormField(ActivityForm, default=lambda: Activity()), min_entries=1
    )
    places = FieldList(FormField(PlaceForm, default=lambda: Place()), min_entries=1)
    days = FieldList(FormField(DayForm, default=lambda: Day()), min_entries=1)
    add_ons = TextAreaField("long description", validators=[Length(min=0, max=2000)])
Example #29
0
class CsvWsForm(BaseForm):
    first_matched_columns = FieldList(FormField(ColumnsForm))
    format_columns = FieldList(FormField(ValueColumnsForm))
    searched_columns = FieldList(FormField(ColumnsForm))
    # `separator` can't be used an a field for wtforms ...
    delimiter = StringField(l_('Delimiter'))
    list_url = StringField(l_('List URL'))
    lookup_url = StringField(l_('Lookup URL'), validators=[InputRequired()])
    timeout = FloatField(l_('Timeout'))
    unique_column = StringField(l_('Unique column'))
Example #30
0
class UserForm(BaseForm):
    subscription_type = SelectField(l_('Subscription Type'), choices=[
        (0, l_('Voice')),
        (1, l_('Unified Communication')),
        (2, l_('Collaboration')),
        (3, l_('Customer Relationship')),
    ], validators=[InputRequired()])
    firstname = StringField(l_('Firstname'), [InputRequired(), Length(max=128)])
    lastname = StringField(l_('Lastname'), [Length(max=128)])
    username = StringField(l_('Username'), [InputRequired(), Length(min=2, max=254)])
    password = StringField(l_('Password'), [Length(min=4, max=64)])
    email = EmailField(l_('Email'), [InputRequired(), Length(max=254)])
    auth_enabled = BooleanField(l_('Enable authentication'))
    caller_id = StringField(l_('Caller ID'), [Length(max=80)])
    mobile_phone_number = StringField(l_('Phone mobile'), [Length(max=80)])
    ring_seconds = IntegerField(l_('Ring seconds'), [NumberRange(min=0, max=60)])
    music_on_hold = SelectField(l_('Music On Hold'), choices=[])
    preprocess_subroutine = StringField(l_('Subroutine'), [Length(max=39)])
    outgoing_caller_id = SelectField(l_('Outgoing caller ID'))
    simultaneous_calls = IntegerField(l_('Simultaneous calls'), [NumberRange(min=1, max=20)])
    timezone = StringField(l_('Timezone'), [Length(max=254)])
    userfield = StringField(l_('User Field'), [Length(max=128)])
    description = StringField(l_('Description'))
    fallbacks = FormField(FallbacksForm)
    forwards = FormField(UserForwardForm)
    services = FormField(UserServiceForm)
    lines = FieldList(FormField(LineForm))
    group_ids = SelectMultipleField(l_('Groups'), choices=[])
    groups = FieldList(FormField(GroupForm))
    funckeys = FieldList(FormField(FuncKeyTemplateKeysForm))
    schedules = FieldList(FormField(ScheduleForm), min_entries=1)
    voicemail = FormField(VoicemailForm)
    call_permission_ids = SelectMultipleField(l_('Call Permissions'), choices=[])
    call_permissions = FieldList(FormField(CallPermissionForm))
    submit = SubmitField(l_('Submit'))