This repository was archived by the owner on Aug 12, 2020. It is now read-only.
This repository was archived by the owner on Aug 12, 2020. It is now read-only.
Changing model field names for file #17
Closed
Description
Having a little trouble following the javascript code. I wanted to create an additional field in the model called: file_2
Then before uploading the file, have the javascript detect if the file is not an image.
If it is an image it uploads the file to the normal file field.
// file = ImageWithThumbsField(upload_to='filefolder', sizes=((75,75),(120,120)), null=True, blank=True)
If the file being uploaded is not an image, then it would use file_2
// file_2 = models.FileField(upload_to='filefolder', null=True, blank=True)
ImageWithThumbsField is working and I can see how detect for an image...just having trouble seeing how the javascript would change the file field name parameter to file_2
Thanks!
Metadata
Metadata
Assignees
Labels
No labels