Commits

Alexey Boriskin  committed d860b8e

Adapt for the django 1.5

  • Participants
  • Parent commits ef85dbe

Comments (0)

Files changed (1)

File versioning/models.py

 from __future__ import absolute_import, unicode_literals
 import copy
 import hashlib
-from datetime import datetime
+try:
+    from django.utils.timezone import now
+except ImportError:
+    from datetime.datetime import now
 
 from django.db import models, IntegrityError
 from django.contrib.contenttypes import generic
     sha1 = models.CharField(max_length=40, db_index=True)
     delta = models.TextField()
 
-    created_at = models.DateTimeField(_("Created at"), default=datetime.now,
+    created_at = models.DateTimeField(_("Created at"), default=now,
                                       db_index=True)
     comment = models.CharField(_("Editor comment"), max_length=255,
                                blank=True)