upload to separate folders for each project

This commit is contained in:
Sanj 2011-10-05 00:40:38 +05:30
parent 79020cd47f
commit 4b2f8845e7

View File

@ -1,8 +1,13 @@
from django.db import models
from os.path import join
def project_thumb_path(instance, filename):
return join('project_thumbs', instance.id, filename)
class Project(models.Model):
title = models.CharField(max_length=255)
thumb_image = models.ImageField(upload_to='project_thumbs/')
thumb_image = models.ImageField(upload_to=project_thumb_path)
size_program = models.TextField(blank=True)
design_statement = models.TextField(blank=True)
extra_text = models.TextField(blank=True)