dynilib / submission

Submission is a Kaggle-like platform to manage machine learning competitions.
MIT License
36 stars 8 forks source link

Prepend timestamp onto uploaded filenames #9

Closed danstowell closed 7 years ago

danstowell commented 7 years ago

To ensure unique filenames.

At present filename is not unique. I see that one user has uploaded "fusion.csv" at least 3 times, and presumably the latest file overwrites, since they're going to the same folder? So this is a problem if we need to access those files.

This simple-minded fix puts the timestamp onto the start of the filename. (Neater would be to use the submission ID number, but that is not known until after the db commit.)

julj commented 7 years ago

A better option to generate unique filenames is, in my opinion, to use uuid:

import uuid
filename = str(uuid.uuid4())
danstowell commented 7 years ago

OK - that would be fine with me