File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Jon Dufresne
Hi, I'm trying to use the File Storage API to create a custom handler for files. Here are my goals: Stored files are represented both in the database and on disk with the following model: class StoredFile(models.Model): name = models.CharField(max_length=255) path = models.CharField(max_

Re: File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Russell Keith-Magee
On Sat, Oct 18, 2014 at 3:32 AM, Jon Dufresne wrote: > Hi, > > I'm trying to use the File Storage API to create a custom handler for > files. Here are my goals: > > Stored files are represented both in the database and on disk with the > following model: > > class StoredFile(models.Model): >

Re: File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Jon Dufresne
On Fri, Oct 17, 2014 at 4:45 PM, Russell Keith-Magee wrote: > Achievable? probably. Easy? No. You're going to be digging in the weeds on > this one. > > If I were trying to do this, I wouldn't try and get this to work with the > existing FileField - I'd be writing my own Field definition. You can