Fixed #23365 -- Added support for timezone-aware datetimes to migrations.

This commit is contained in:
Rudy Mutter 2014-09-06 13:42:36 -07:00 committed by Tim Graham
parent 12809e1609
commit a407b846b4
5 changed files with 56 additions and 11 deletions

View file

@ -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
^^^^^^

View file

@ -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)