mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
added compat shim for utc/UTC
This commit is contained in:
parent
e2337e1072
commit
5436df54c6
|
@ -312,3 +312,12 @@ def set_many(instance, field, value):
|
|||
else:
|
||||
field = getattr(instance, field)
|
||||
field.set(value)
|
||||
|
||||
|
||||
try:
|
||||
# A `utc` instance is available in Django 1.11+
|
||||
from django.timezone import utc
|
||||
except ImportError:
|
||||
# A `UTC` class is available in older versions
|
||||
from django.timezone import UTC
|
||||
utc = UTC()
|
||||
|
|
Loading…
Reference in New Issue
Block a user