Skip to content
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
@mrbm

Description

@mrbm

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions