changeset 94:dcd097a59223

For Django 1.5: slugify is now available in django.utils.text.
author Brian Neal <bgneal@gmail.com>
date Wed, 28 Aug 2013 19:00:43 -0500
parents 388be986392e
children 7b52e8ef01ec
files photologue/models.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/photologue/models.py	Wed Aug 28 18:32:57 2013 -0500
+++ b/photologue/models.py	Wed Aug 28 19:00:43 2013 -0500
@@ -1,6 +1,5 @@
 import os
 import random
-import shutil
 import zipfile
 
 from datetime import datetime
@@ -11,7 +10,7 @@
 from django.conf import settings
 from django.core.files.base import ContentFile
 from django.core.urlresolvers import reverse
-from django.template.defaultfilters import slugify
+from django.utils.text import slugify
 from django.utils.functional import curry
 from django.utils.translation import ugettext_lazy as _
 
@@ -230,7 +229,7 @@
                         slug = slugify(title)
                         try:
                             p = Photo.objects.get(title_slug=slug)
-                        except Photo.DoesNotExist:                            
+                        except Photo.DoesNotExist:
                             photo = Photo(title=title, title_slug=slug,
                                           caption=self.caption,
                                           is_public=self.is_public,