Hello, In django before version 1.4, there was an option in the model for models. FileField to specify "dynamically" the created path to store files in the upload_to variable
models.py #... attach = models.FileField(verbose_name=u'Приложение', blank=True, upload_to=lambda instance, filename: 'attach/%s/%s' % (instance.id,filename))
D django version 1.4 seems to be assigned an id later and therefore instance.id = None and also instance.pk = None. Tell me how you can specify the model id in the path.