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!") ]))
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!")]))
class TextUploadForm(Form): upload = FileField("Upload file", validators=[file_required(), file_allowed(text)])
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)
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()])
class Upload_Form(Form): name = TextField('Name', validators = [Required(), Length(min=1, max=12)]) img_file = FileField("Image", validators = [file_required()])