From bcdfcef42fcf79aa55db0369b10771ca50c49dc2 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 5 Oct 2011 00:57:11 +0530 Subject: [PATCH] slug field --- urbstudio/urb/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/urbstudio/urb/models.py b/urbstudio/urb/models.py index 4cf6077..be16170 100644 --- a/urbstudio/urb/models.py +++ b/urbstudio/urb/models.py @@ -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)