Re: building directory path with user table

2009-08-05 Thread neridaj
I've revised my code but files are still getting uploaded to the 'listings' directory. class Listing(models.Model): user = models.ForeignKey(User) zipfile = models.FileField(upload_to='listings') name = models.CharField(max_length=50) order = models.ForeignKey('Order') def ov

Re: building directory path with user table

2009-07-22 Thread neridaj
I'm new to django and not sure how to do this, is this remotely close? class Listing(models.Model): user = models.ForeignKey(User, unique=True) zipfile = models.FileField(upload_to='listings') name = models.CharField(max_length=50) order = models.ForeignKey('Order') def save(

Re: building directory path with user table

2009-07-18 Thread Eugene Mirotin
What you have written (this join for user_dir_path) is evaluated only once on model class creation, but what you need is evaluating it for each specific object. I recommend you overloading the model save method to alter the image save path. On Jul 17, 10:44 am, "neri...@gmail.com" wrote: > Hell

building directory path with user table

2009-07-17 Thread neri...@gmail.com
Hello, I'm trying to build a photo upload path which corresponds to the selected user i.e., when the user is selected from the drop down the username gets appended to the file upload path dynamically. If you have any ideas I would like to hear them: class Listing(models.Model): user = mo