{ "info": { "author": "Emilio A. S\u00e1nchez", "author_email": "emilio@commite.co", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "fixturemigration\n================\n\nA django app that allows you to load a fixture in a particular migration\nstate.\n\nWhat's the problem?\n-------------------\n\nIf your django apps use fixtures then you already know that initial\nloading of fixtures has been deprecated since django version 1.7. If you\nwant to load initial data you must use a data migration.\n\nUsing a `data\nmigration `__\nis quite easy, you can add a RunPython migration that calls a function\nlike:\n\n::\n\n def load_data(apps, schema_editor):\n Book = apps.get_model('library', 'Book')\n Book.objects.bulk_create([\n Book(name='The Litte Prince'),\n Book(name='The Ingenious Gentleman Don Quixote of La Mancha'),\n ])\n\nThat works great but if you need to create many objects it could be a\npain to write this function. Some people try to load a full fixture file\nfrom a migration by doing a RunPython migration with the following code:\n\n::\n\n def load_data(apps, schema_editor):\n call_command('loaddata', 'books_data.json')\n\nWell, that seems to work but it has a serious problem. If your models\ncontinue evolving you will add more schema migrations and everything\nwill seem to work right unless you try to migrate from scratch.\n\nWhen you arrive to the data migration the loaddata command will try to\ndeserialize the objects in your fixture using the current code in your\nmodels but currently you are half way applying migrations and your old\nfixture is not compatible with your models. Then you have to remove the\ndata migration, apply all the migrations, update your old fixture to the\nnew changes and load it manually.\n\nSi finally you'll end mantaining a fixture file and loading it manually\nafter all migrations are applied.\n\nWhat's the solution?\n--------------------\n\nWell, if you really want to load a fixture in a migration step then you\ncould use fixturemigration. It creates a migration step that will load\nany fixture using the current migration state instead of getting the\nfinal models.\n\nInstallation\n============\n\n1. Install fixturemigration from PyPI\n\n ::\n\n $ pip install django-fixturemigration\n\n2. Edit your project's ``settings.py``:\n\n ::\n\n INSTALLED_APPS = (\n ...\n 'fixturemigration'\n )\n\nInstructions to use\n===================\n\n1. Create your fixture like you always do, right now fixturemigration\n require that the fixture file will be in json format\n\n ::\n\n $ ./manage.py dumpdata --format=json --indent=4 app1 app2 > aap1/fixtures/20150723_data.json\n\n We have entered the data in the name but you can use any name you\n want.\n\n2. Add a special migration and tell it to load this fixture\n\n ::\n\n $ ./manage.py make_fixturemigration app1 --fixture 20150723_data.json\n\n Note that you need one app to store your new migration. The new\n migration will have dependencies with the latest migration of each\n app so when it load the fixture the state will be the same that when\n it was created.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/emiliosanchez/django-fixturemigration", "keywords": "django,migrations,fixtures", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-fixturemigration", "package_url": "https://pypi.org/project/django-fixturemigration/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-fixturemigration/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/emiliosanchez/django-fixturemigration" }, "release_url": "https://pypi.org/project/django-fixturemigration/0.7/", "requires_dist": null, "requires_python": null, "summary": "An app to load fixtures inside a migration data step", "version": "0.7" }, "last_serial": 1655603, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "24e470f03c20735e8f9c3e79b57654ea", "sha256": "910897779445a5f4da67afd0693f5959a2d2fc1132358337b76f4b70253c5e06" }, "downloads": -1, "filename": "django-fixturemigration-0.1.tar.gz", "has_sig": false, "md5_digest": "24e470f03c20735e8f9c3e79b57654ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1053, "upload_time": "2015-07-23T17:16:10", "url": "https://files.pythonhosted.org/packages/41/88/72f6cf6ba1a155e9f05e1ba82d5a7629800fec7026baadfcab10435b0824/django-fixturemigration-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "d78beaf6c6d823a59f57299ddc7d3b61", "sha256": "9867da9fc86e18ad7a65fe813dfd6221014867b6b29c5d4b44f53727cd2ca557" }, "downloads": -1, "filename": "django-fixturemigration-0.2.tar.gz", "has_sig": false, "md5_digest": "d78beaf6c6d823a59f57299ddc7d3b61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6277, "upload_time": "2015-07-23T17:21:19", "url": "https://files.pythonhosted.org/packages/58/e1/65163a99ef0d51361b9b228b8e7440cd5d0a53baf27c1cf5dbdb649e47c9/django-fixturemigration-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7b3b636f6e2ce1af11b6e79af3e9577d", "sha256": "2052ef0b206ddd9a4a8f32af527491994c442bade668f8a89da598da9a909d25" }, "downloads": -1, "filename": "django-fixturemigration-0.3.tar.gz", "has_sig": false, "md5_digest": "7b3b636f6e2ce1af11b6e79af3e9577d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6320, "upload_time": "2015-07-23T17:30:36", "url": "https://files.pythonhosted.org/packages/93/3c/666adae3ea7806b3cd68548a89e9c7fb2bc836a0068529caa207f41e0ac2/django-fixturemigration-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "bf4eaf63fe9ac5e7e9fdcd1d5b937901", "sha256": "64702e3503815a137305f2be5ac3b0d8446524ae49d2407d2768a7988871fe55" }, "downloads": -1, "filename": "django-fixturemigration-0.4.tar.gz", "has_sig": false, "md5_digest": "bf4eaf63fe9ac5e7e9fdcd1d5b937901", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6339, "upload_time": "2015-07-23T17:34:50", "url": "https://files.pythonhosted.org/packages/9d/58/5c03e69bdb9d5eb863ac5b89a566dfa65c1b6286ad621ff80cf08b608fb4/django-fixturemigration-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "6712199b592d5ad4be5b6e8f741fd129", "sha256": "e2cd1d1c33ec786f5419d8f5467289c14e0d74e802c57f8990939bb778bf4413" }, "downloads": -1, "filename": "django-fixturemigration-0.5.tar.gz", "has_sig": false, "md5_digest": "6712199b592d5ad4be5b6e8f741fd129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6628, "upload_time": "2015-07-23T17:43:58", "url": "https://files.pythonhosted.org/packages/1b/0e/84b44223608fc492b66ed86fad056af66468105f9291498ff45a7d546cea/django-fixturemigration-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "10b366d8bec9e83add3ab897988d8602", "sha256": "9e0b54466a9e2ff0f579655e9aaf3c454147f4b5cc469dd37777e476a8a96074" }, "downloads": -1, "filename": "django-fixturemigration-0.6.tar.gz", "has_sig": false, "md5_digest": "10b366d8bec9e83add3ab897988d8602", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6637, "upload_time": "2015-07-23T17:48:39", "url": "https://files.pythonhosted.org/packages/23/bd/87322b49809c86854b55e04eed6b538c5a257a2fd1b8d55b57f104f8d9e5/django-fixturemigration-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "5ed102b247a8b9730cc6325cc34a6f0c", "sha256": "b76cffc2fb33c5b3e9198444e31f7758b9f37e7efb6b33a01f139c60c5a77264" }, "downloads": -1, "filename": "django-fixturemigration-0.7.tar.gz", "has_sig": false, "md5_digest": "5ed102b247a8b9730cc6325cc34a6f0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6741, "upload_time": "2015-07-29T19:43:32", "url": "https://files.pythonhosted.org/packages/a4/5f/152ef684249a7b8d08b1011914ec146b2bf157f30183926d83bc2fb64cac/django-fixturemigration-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ed102b247a8b9730cc6325cc34a6f0c", "sha256": "b76cffc2fb33c5b3e9198444e31f7758b9f37e7efb6b33a01f139c60c5a77264" }, "downloads": -1, "filename": "django-fixturemigration-0.7.tar.gz", "has_sig": false, "md5_digest": "5ed102b247a8b9730cc6325cc34a6f0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6741, "upload_time": "2015-07-29T19:43:32", "url": "https://files.pythonhosted.org/packages/a4/5f/152ef684249a7b8d08b1011914ec146b2bf157f30183926d83bc2fb64cac/django-fixturemigration-0.7.tar.gz" } ] }