Your question is a bit at a dead end, because I personally have in version up to 1.4 also ID I was not available in upload_to .
In general, the issue of storing files of files is quite beaten. For me, the most normal option with building hash from timeStamp Сode> + the file name and the creation of directory on the first 4m chases of the hash
Upload_to = 'upload_path/%s/%s/%s.jpg' %( hash [: 1 ], hash [ 2 : 3 ], hash )
update regards the ID in the file name. You need to save the file, i.e. After assigning id in the database generate a new path and accordingly move the file along the new path. On my subjective opinion, the operation is too costly.
update2
import span> uuid def get_file_path ( instance, filename ): ext = filiname.split ( ''. ') [- 1 ] Filename = ""%s "" %(uuid.uuid4 (), ext) retu 'uploads/%s/%s/%s.jpg' %(Filename [: 1 ], Filename [ 2 : Pre> and in the model
file = models.filefield (upload_to = get_file_patH, , null = true , Blank = true , verbose_name = _ ( u'contact List '))