示例#1
0
 def __init__(self, fileFieldName='file', *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     setattr(
         self, fileFieldName,
         FileField("Photo Upload",
                   validators=[
                       file_required(),
                       file_allowed(images, "Images only!")
                   ]))
示例#2
0
 def __init__(self, fileFieldName='file', *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     setattr(self,fileFieldName,FileField("Photo Upload", validators=[file_required(),
                                 file_allowed(images, "Images only!")]))
示例#3
0
class TextUploadForm(Form):
    upload = FileField("Upload file",
                       validators=[file_required(),
                                   file_allowed(text)])
示例#4
0
class ImageUploadForm(Form):
    upload = FileField("Upload file",
                       validators=[file_required(),
                                   file_allowed(images)])
 def __call__(self, form, field):
     if form.request_funding.data:
         if self.file_required:
             file_required(self.message)(form, field)
         else:
             required(self.message)(form, field)
示例#6
0
class UploadForm(Form):
    """ Form used to upload the MapQTL output file and the JoinMap map
    file.
    """
    mapqtl_input = FileField("Input zip files", validators=[file_required()])
示例#7
0
class Upload_Form(Form):
    name = TextField('Name', validators = [Required(), Length(min=1, max=12)])
    img_file = FileField("Image", validators = [file_required()])