I have a model for storing files:
class AFile(models.Model):
path = models.CharField(max_length=256)
name = models.CharField(max_length=256)
file = models.FileField(upload_to=get_path)
there are many views that save files. I want a seperate path for each. so I put path in the model and use that in the get path function. like so:
afile = AFile(path='blah/foo/', name='filex.jpg')
afile.save()
so the file is in the right spot. But I don't really want to store the path and name field in my database, its only there to generate a path. any way to achieve this same thing without extra model fields?