slug field
This commit is contained in:
parent
9ac04ec4e9
commit
bcdfcef42f
|
@ -2,11 +2,12 @@ from django.db import models
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
def project_thumb_path(instance, filename):
|
def project_thumb_path(instance, filename):
|
||||||
return join('project_thumbs', instance.id, filename)
|
return join('project_thumbs', instance.slug, filename)
|
||||||
|
|
||||||
|
|
||||||
class Project(models.Model):
|
class Project(models.Model):
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
|
slug = models.SlugField()
|
||||||
thumb_image = models.ImageField(upload_to=project_thumb_path)
|
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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user