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
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(
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
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
4 matches
Mail list logo