Closed maz1987in closed 2 years ago
UploadedFileField
is for a single file (as it's a reference to a file), but you can subclass it and upload multiple files like what UploadedImageWithThumb
does ( https://github.com/amol-/depot/blob/master/depot/fields/specialized/image.py )
I am new to python. so sorry is the question if seen non-sense: in SQLAlchemy field
photo = Column(UploadedFileField(upload_storage ='media'))
could I change upload_storage base on another field?
like:
storage = Column(String(length=255))
photo = Column(UploadedFileField(upload_storage =storage))
in other words, Could I change the upload_storage
in the fly?
I think you should be able to achieve that by setting the depot_name
in a UploadedFile
you provide for the column
class Document(DeclarativeBase):
...
storage = Column(String(length=255))
photo = Column(UploadedFileField)
doc = Document()
doc.photo = UploadedFile(file_content, depot_name=doc.storage)
Thank you it's working
what about thumbnail filter could also be changed?
@amol- Thanks for your help I have been able to do amazing work with your wonderful project
I would like to upload multiple files to the database files