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
|
||||
|
||||
def project_thumb_path(instance, filename):
|
||||
return join('project_thumbs', instance.id, filename)
|
||||
return join('project_thumbs', instance.slug, filename)
|
||||
|
||||
|
||||
class Project(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
slug = models.SlugField()
|
||||
thumb_image = models.ImageField(upload_to=project_thumb_path)
|
||||
size_program = models.TextField(blank=True)
|
||||
design_statement = models.TextField(blank=True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user