mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #23365 -- Added support for timezone-aware datetimes to migrations.
This commit is contained in:
parent
12809e1609
commit
a407b846b4
5 changed files with 56 additions and 11 deletions
|
@ -260,6 +260,8 @@ Management Commands
|
|||
* The :djadminopt:`--name` option for :djadmin:`makemigrations` allows you to
|
||||
to give the migration(s) a custom name instead of a generated one.
|
||||
|
||||
* :djadmin:`makemigrations` can now serialize timezone-aware values.
|
||||
|
||||
Models
|
||||
^^^^^^
|
||||
|
||||
|
|
|
@ -543,12 +543,17 @@ Django can serialize the following:
|
|||
- ``int``, ``long``, ``float``, ``bool``, ``str``, ``unicode``, ``bytes``, ``None``
|
||||
- ``list``, ``set``, ``tuple``, ``dict``
|
||||
- ``datetime.date``, ``datetime.time``, and ``datetime.datetime`` instances
|
||||
(include those that are timezone-aware)
|
||||
- ``decimal.Decimal`` instances
|
||||
- Any Django field
|
||||
- Any function or method reference (e.g. ``datetime.datetime.today``) (must be in module's top-level scope)
|
||||
- Any class reference (must be in module's top-level scope)
|
||||
- Anything with a custom ``deconstruct()`` method (:ref:`see below <custom-deconstruct-method>`)
|
||||
|
||||
.. versionchanged:: 1.8
|
||||
|
||||
Support for serializing timezone-aware datetimes was added.
|
||||
|
||||
Django can serialize the following on Python 3 only:
|
||||
|
||||
- Unbound methods used from within the class body (see below)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue