slug field

This commit is contained in:
Sanj 2011-10-05 00:57:11 +05:30
parent 9ac04ec4e9
commit bcdfcef42f

View File

@ -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)