upload to separate folders for each project
This commit is contained in:
parent
79020cd47f
commit
4b2f8845e7
|
@ -1,8 +1,13 @@
|
||||||
from django.db import models
|
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):
|
class Project(models.Model):
|
||||||
title = models.CharField(max_length=255)
|
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)
|
size_program = models.TextField(blank=True)
|
||||||
design_statement = models.TextField(blank=True)
|
design_statement = models.TextField(blank=True)
|
||||||
extra_text = models.TextField(blank=True)
|
extra_text = models.TextField(blank=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user