I am new to django and sqlite. From the code below i will upload my file to 'documents', since there is an overwrite storage function, if i upload the same file name with another query i will overwrite the old one which i dont wan it to be happend. So what I am thinking is to get the query id or pk as the directory.
Its there anyway to store my upload file via their pk or id?
First define a function
def upload(instance, filename): return "document/" + instance.user.name +"/" + filename
And in the filefield of model