Commit Graph

32 Commits

Author SHA1 Message Date
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
Loic Bistuer d59f1993f1 Made MigrationWriter look for a "deconstruct" attribute on functions.
Refs #20978.
2013-09-10 10:12:23 -04:00
Loic Bistuer adc0ab3386 Fixed #21037 -- Made MigrationWriter raise a ValueError when serializing lambda functions. 2013-09-06 20:13:01 -04:00
Loic Bistuer ff9e116198 Fixed #21008 -- Made MigrationWriter handle Promise objects. 2013-08-31 20:26:44 -04:00
Alex Gaynor 8363406dad Removed usage of u"" string prefix, which doesn't work on python3.2 2013-08-23 04:56:37 -07:00
Andrew Godwin 2ae8a8a77d Fix test running with new apps stuff/migrate actually running migrations 2013-06-19 15:36:02 +01:00
Andrew Godwin 91c470def5 Auto-naming for migrations and some writer fixes 2013-06-07 17:56:43 +01:00
Andrew Godwin c7aa4b5338 Field encoding 2013-06-07 15:36:31 +01:00
Andrew Godwin 4492f06408 A bit of an autodetector and a bit of a writer 2013-06-07 15:28:38 +01:00