From 665fc04b7e4a237d53e73c8cfe59fb0847cbd656 Mon Sep 17 00:00:00 2001 From: jarekwg Date: Wed, 28 Oct 2015 23:47:33 +1100 Subject: [PATCH] Must use the 'Now' database function in django>=1.9 --- model_utils/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model_utils/models.py b/model_utils/models.py index f343dfb..142b77c 100644 --- a/model_utils/models.py +++ b/model_utils/models.py @@ -1,10 +1,15 @@ from __future__ import unicode_literals +import django from django.db import models from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import FieldDoesNotExist from django.core.exceptions import ImproperlyConfigured -from django.utils.timezone import now +if django.VERSION >= (1, 9, 0): + from django.db.models.functions import Now + now = Now() +else: + from django.utils.timezone import now from model_utils.managers import QueryManager from model_utils.fields import AutoCreatedField, AutoLastModifiedField, \