Upgrade django-allauth.
[wolnelektury.git] / apps / lesmianator / models.py
index 7fceda2..83e8213 100644 (file)
@@ -9,10 +9,9 @@ from StringIO import StringIO
 
 from django.core.files.base import ContentFile
 from django.db import models
 
 from django.core.files.base import ContentFile
 from django.db import models
-from django.db.models import permalink
+from django.utils.timezone import utc
 from django.utils.translation import ugettext_lazy as _
 from django.core.urlresolvers import reverse
 from django.utils.translation import ugettext_lazy as _
 from django.core.urlresolvers import reverse
-from django.db.models.signals import m2m_changed
 from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
 from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
@@ -40,7 +39,7 @@ class Poem(models.Model):
 
     def visit(self):
         self.view_count += 1
 
     def visit(self):
         self.view_count += 1
-        self.seen_at = datetime.now()
+        self.seen_at = datetime.utcnow().replace(tzinfo=utc)
         self.save()
 
     def __unicode__(self):
         self.save()
 
     def __unicode__(self):
@@ -137,7 +136,7 @@ class Continuations(models.Model):
             mydict[letter] += 1
             last_word = last_word[-length+1:] + letter
         # add children
             mydict[letter] += 1
             last_word = last_word[-length+1:] + letter
         # add children
-        return reduce(cls.join_conts, 
+        return reduce(cls.join_conts,
                       (cls.get(child) for child in book.children.all().iterator()),
                       conts)
 
                       (cls.get(child) for child in book.children.all().iterator()),
                       conts)