Christopher Luc
a7bc00e17b
Fixed #24514 -- Made migration writer omit models import if it's unused.
2015-04-10 07:04:26 -04:00
Marten Kenbeek
e8e4f978dd
Fixed #24278 -- Fixed serialization of migration operations.
...
Fixed MigrationWriter.serialize() to correctly handle migration
operations by utilizing OperationWriter.
Thanks Piotr Maliński for the report.
2015-04-05 20:26:21 +02:00
Marten Kenbeek
d597174bd4
Refs #24278 -- Allowed multi-line serializations in OperationWriter.
...
Changed OperationWriter to support multi-line serialized values with
correct indentation.
2015-04-05 20:19:24 +02:00
Baptiste Mispelon
30a3c2f74c
Fixed #24566 -- Added support for serializing timedelta
...
Thanks to knbk for the report.
2015-04-02 17:21:20 +02:00
Baptiste Mispelon
1aadade373
Fixed #24521 -- Added support for serializing frozensets in migrations.
2015-03-23 15:38:25 +01:00
Tim Graham
307c0f299a
Refs #24324 -- Fixed Python 2 test failures when path to Django source contains non-ASCII characters.
2015-02-17 19:03:03 -05:00
Tim Graham
0ed7d15563
Sorted imports with isort; refs #23860 .
2015-02-06 08:16:28 -05:00
Markus Holtermann
7f20041bca
Fixed #24155 -- Maintained kwargs and import order in migration writer
...
Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
2015-01-20 01:24:41 +01:00
Markus Holtermann
65d55c4093
Cleaned up migration writer tests
2015-01-17 20:29:50 +01:00
Markus Holtermann
862ea825b5
Fixed #24093 -- Prevented MigrationWriter to write operation kwargs that are not explicitly deconstructed
2015-01-07 17:29:20 -07:00
Claude Paroz
51890ce889
Applied ignore_warnings to Django tests
2014-12-30 18:16:25 +01:00
Oscar Ramirez
54085b0f9b
Fixed #23998 -- Added datetime.time support to migrations questioner.
2014-12-22 07:24:54 -05:00
Markus Holtermann
3ef50a772b
Fixed reverse test execution for migration manager tests
...
Thanks to Tim Graham for reporting the issue; refs #23822
2014-12-15 17:54:40 -05:00
Markus Holtermann
aa5ef0d4fc
Fixed #23822 -- Added support for serializing model managers in migration
...
Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin,
Tim Graham, Carl Meyer, and others for their review and input.
2014-12-15 08:34:15 -05:00
Gavin Wahl
dee4d23f7e
Fixed #23950 -- Prevented calling deconstruct on classes in MigrationWriter.
2014-12-03 08:22:29 -05:00
Markus Holtermann
c7c098cf97
Fixed #23770 -- Changed serialization strategy for floats with respect to NaN and Inf
...
Thanks to w0rp for the report
2014-11-06 15:30:30 +01:00
Rudy Mutter
a407b846b4
Fixed #23365 -- Added support for timezone-aware datetimes to migrations.
2014-09-29 20:45:43 -04:00
Thomas Chaumeny
b2aad7b836
Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.
...
Thanks Collin Anderson for the review.
2014-09-29 00:01:38 +07:00
Loic Bistuer
b23d47412c
Fixed #23560 -- Fixed MigrationWrite to handle builtin types without imports.
...
Thanks Tim Graham for the review.
2014-09-27 00:36:28 +07:00
Markus Holtermann
16548cfc7c
Fixed broken test from da160d440f; refs #23418 .
2014-09-08 16:49:06 -04:00
Markus Holtermann
d28b5f13b3
Fixed #23418 -- Fail when migration deconstruct produces invalid import
2014-09-08 21:27:34 +02:00
Lee Sanghyuck
11d9cbe2f4
Fixed #23316 -- Added datetime.time serialization in migrations.
2014-08-19 13:31:46 -04:00
Tim Graham
66211b4b75
Silenced a Python 2 ImportWarning in a migrations test.
2014-07-24 09:24:52 -04:00
Simon Charette
35c2c37041
Fixed #22943 -- Correctly serialize compiled regexes.
...
Thanks to antialiasis at gmail dot com for the patch.
2014-07-04 13:34:20 -04:00
Colin Wood
27ee608b55
Fixed #22940 -- Added missing string iterpolation parameters in migrations.writer error.
...
Forwardport of f5740af868
from stable/1.7.x
2014-07-02 12:45:02 -04:00
Víðir Valberg Guðmundsson
3a6cb9f497
Fixed #22577 : Python 3 broke on non-module migrations directory
2014-06-17 18:21:38 +02:00
Matthew Schinckel
bb39037fcb
Fixed #22788 -- Ensured custom migration operations can be written.
...
This inspects the migration operation, and if it is not in the
django.db.migrations module, it adds the relevant imports to the
migration writer and uses the correct class name.
2014-06-16 12:28:52 -04:00
Andrew Godwin
6fd455adfc
Fixed #22436 : More careful checking on method ref'ce serialization
2014-06-07 17:05:51 -07:00
Baptiste Mispelon
f01d2a8f9b
Fixed tuple serialization test.
...
Thanks to rockallite for the report.
2014-05-23 14:50:10 +02:00
Moayad Mardini
ad994a3c5b
Fixed #22679 -- Fixed empty tuple serialization in MigrationWriter.
...
Thanks rockallite.wulf for the report.
2014-05-22 16:15:09 +02:00
Claude Paroz
e520a73eee
Harmonized some PEP 0263 coding preambles
2014-05-15 19:58:41 +02:00
Aymeric Augustin
428c0bbe1b
Appeased flake8 2.1.0.
2014-04-21 12:27:34 +02:00
Simon Charette
72d3889db4
Fixed #22350 -- Consistently serialize bytes and text in migrations.
...
Thanks to @treyhunner and Loïc for their suggestions and review.
2014-04-13 18:22:26 -04:00
Simon Charette
074d3183d9
Fixed #22363 -- Correctly serialize `django.utils.datetime_safe` objects.
...
Thanks to linovia for the report.
2014-04-03 14:54:16 -04:00
Andrew Godwin
97a8fd4682
Fixed #21954 : Raise nice error when serializing datetimes with timezones
2014-02-09 11:17:38 +00:00
Alex Gaynor
2ba09c000d
Added some missing whitespace around arithmetic operators
2014-01-22 09:21:05 -06:00
Markus Holtermann
047394f79c
Fixed #21852 -- Make migration writer serialize iterators
2014-01-22 09:21:54 +01:00
Loic Bistuer
374faa4721
Fixed #21323 -- Improved readability of serialized Operation.
2014-01-20 00:16:07 +07:00
Andrew Godwin
c9de1b4a55
Implement swappable model support for migrations
2014-01-19 16:43:12 +00:00
Aymeric Augustin
da16bb30ff
Dropped AppCache._empty, _with_app and _without_app.
...
It's now easier to achieve the same effect with modify_settings or
override_settings.
2013-12-23 21:37:56 +01:00
Aymeric Augustin
2fef9e5375
Moved apps back in the toplevel django namespace.
...
Reverted 4a56a93cc4
.
2013-12-22 11:39:55 +01:00
Aymeric Augustin
2239081ff1
Expurged INSTALLED_APPS from code and tests.
...
Except the app cache code and a few specific tests, of course.
2013-12-22 11:39:18 +01:00
Aymeric Augustin
f25fa9d859
Deprecated load_app().
...
Adjusted several tests that used it to add apps to the app cache and
then attempted to remove them by manipulating attributes directly.
Also renamed invalid_models to invalid_models_tests to avoid clashing
application labels between the outer and the inner invalid_models
applications.
2013-12-22 11:39:17 +01:00
Aymeric Augustin
4a56a93cc4
Moved the new app cache inside core.
2013-12-17 10:17:46 +01:00
Aymeric Augustin
8662654d6d
Removed module-level functions for the app cache.
...
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.
They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.
This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
2013-12-17 10:17:44 +01:00
Aymeric Augustin
9217b89da3
Removed BaseAppCache.app_store.
...
It was only storing redundant information. This is part of the effort to
allow applications without a models module.
2013-12-17 10:17:44 +01:00
Aymeric Augustin
860c2c8bc5
Moved django.db.models.loading to django.apps.cache.
...
This commit doesn't contain any code changes; it's purely a refactoring.
2013-12-17 10:17:43 +01:00
Loic Bistuer
e565e1332d
Fixed #21275 -- Fixed a serializer error when generating migrations for contrib.auth.
...
The migration serializer now looks for a deconstruct method on any object.
2013-10-21 14:54:52 -04:00
Loic Bistuer
8d6953d55c
Added support for serializing class methods. - Refs #21290 .
...
The new handling allows us to do away with the whitelisting that was
required to support date and datetime objects.
2013-10-19 12:10:18 -04:00
Loic Bistuer
584110417f
Fixed #21283 -- Added support for migrations if models is a package.
...
Thanks Markus Holtermann for the report.
2013-10-19 09:48:57 -04:00