mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-24 07:20:22 +00:00
Must use the 'Now' database function in django>=1.9
This commit is contained in:
parent
165e0ec495
commit
665fc04b7e
1 changed files with 6 additions and 1 deletions
|
|
@ -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, \
|
||||
|
|
|
|||
Loading…
Reference in a new issue