{ "info": { "author": "Sebastian Vetter", "author_email": "sebastian@roadside-developer.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python" ], "description": "=============================\r\nswapify - Swappables in South\r\n=============================\r\n\r\n.. image:: https://travis-ci.org/elbaschid/swapify.png?branch=master\r\n :target: https://travis-ci.org/elbaschid/swapify?branch=master\r\n\r\nAfter the custom user model was brought upon the Django community, it had all\r\nthe attention it well deserved and more and more re-usable apps are providing\r\nsupport for custom user models.\r\n\r\nI've been working with `django-oscar`_ and many of its extensions over the past\r\ntwo years. Oscar added support for the custom user models in its 0.6 release\r\nand `django-fancypages`_ even goes beyond that and leverages `the (hidden)\r\nswappable API`_.\r\n\r\nOne of the few things that could be considered troublesome with models that are\r\nswappable, is providing compatible South migrations. Over the last few months,\r\nI've had to touch enough migrations and replace ``auth.User`` with\r\n``AUTH_USER_MODEL`` to be annoyed by it and automate the situation.\r\n\r\nBehold ``swapify``, the little commandline tool that fixes your migrations for\r\na swappable model of your choice (on at a time). It checks your migration\r\nfiles for you swappable and updates the migrations if required.\r\n\r\nThis is a first attempt based on my own experiences. There's probably uncovered\r\nground and potential for improvement out there...so feedback is very welcome.\r\n\r\nEnjoy!\r\n\r\n.. _`django-oscar`:\r\n.. _`django-fancypages`:\r\n.. _`the (hidden) swappable API`: https://code.djangoproject.com/ticket/19103\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nYou can either install the latest release from PyPI::\r\n\r\n pip install swapify\r\n\r\nor install the latest development version from github::\r\n\r\n pip install https://github.com/elbaschid/swapify/archive/master.tar.gz\r\n\r\n\r\nUsage\r\n-----\r\n\r\nGet a list of all migrations in a directory that require fixing::\r\n\r\n swapify list myproject/ --model auth.User\r\n\r\nUpdate all migrations to work with swapped models::\r\n\r\n swapify apply myproject/ --model auth.User\r\n\r\nYou can also test updating the files and get the output on ``stdout``::\r\n\r\n swapify apply myproject/ --model auth.User --dry-run\r\n\r\nAnd for very custom models you can even do::\r\n\r\n swapify apply myproject/ --model swap.Swappable --var-name MYSWAP_SWAPPABLE_MODEL\r\n\r\n\r\nLicense\r\n-------\r\n\r\n*swapify* is available under the MIT license.\r\n\r\n\r\n.. image:: https://d2weczhvl823v0.cloudfront.net/elbaschid/swapify/trend.png", "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/elbaschid/swapify", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "swapify", "package_url": "https://pypi.org/project/swapify/", "platform": "linux", "project_url": "https://pypi.org/project/swapify/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/elbaschid/swapify" }, "release_url": "https://pypi.org/project/swapify/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Make migrations work with swappable models.", "version": "0.1.1" }, "last_serial": 987905, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "215c96d8110bec30228d4dbb0e803216", "sha256": "63ab062b13ec09ec77c5071712a4727eb39027b7f74d1d3b22db5bcc18445125" }, "downloads": -1, "filename": "swapify-0.1.0.tar.gz", "has_sig": false, "md5_digest": "215c96d8110bec30228d4dbb0e803216", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8853, "upload_time": "2014-01-31T13:24:58", "url": "https://files.pythonhosted.org/packages/d9/09/8f574dd2dc6f7b541db49339732d2c889878b5cf4fe89da783a288903207/swapify-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8fc0667a08ccebac0c735d1c0625c950", "sha256": "adf962677050ff8c0866ffc9cf810977cc1b782f397f4d283ecd2d12a58cae76" }, "downloads": -1, "filename": "swapify-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8fc0667a08ccebac0c735d1c0625c950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8879, "upload_time": "2014-02-01T13:55:34", "url": "https://files.pythonhosted.org/packages/d0/1a/1ac4877fd17e0126018e5812acc933ae2cba5b8454e3d4af9fac2f05de46/swapify-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8fc0667a08ccebac0c735d1c0625c950", "sha256": "adf962677050ff8c0866ffc9cf810977cc1b782f397f4d283ecd2d12a58cae76" }, "downloads": -1, "filename": "swapify-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8fc0667a08ccebac0c735d1c0625c950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8879, "upload_time": "2014-02-01T13:55:34", "url": "https://files.pythonhosted.org/packages/d0/1a/1ac4877fd17e0126018e5812acc933ae2cba5b8454e3d4af9fac2f05de46/swapify-0.1.1.tar.gz" } ] }