This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

After the custom user model was brought upon the Django community, it had all the attention it well deserved and more and more re-usable apps are providing support for custom user models.

I’ve been working with django-oscar and many of its extensions over the past two years. Oscar added support for the custom user models in its 0.6 release and django-fancypages even goes beyond that and leverages the (hidden) swappable API.

One of the few things that could be considered troublesome with models that are swappable, is providing compatible South migrations. Over the last few months, I’ve had to touch enough migrations and replace auth.User with AUTH_USER_MODEL to be annoyed by it and automate the situation.

Behold swapify, the little commandline tool that fixes your migrations for a swappable model of your choice (on at a time). It checks your migration files for you swappable and updates the migrations if required.

This is a first attempt based on my own experiences. There’s probably uncovered ground and potential for improvement out there…so feedback is very welcome.

Enjoy!

Installation

You can either install the latest release from PyPI:

pip install swapify

or install the latest development version from github:

pip install https://github.com/elbaschid/swapify/archive/master.tar.gz

Usage

Get a list of all migrations in a directory that require fixing:

swapify list myproject/ --model auth.User

Update all migrations to work with swapped models:

swapify apply myproject/ --model auth.User

You can also test updating the files and get the output on stdout:

swapify apply myproject/ --model auth.User --dry-run

And for very custom models you can even do:

swapify apply myproject/ --model swap.Swappable --var-name MYSWAP_SWAPPABLE_MODEL

License

swapify is available under the MIT license.

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
swapify-0.1.1.tar.gz (8.9 kB) Copy SHA256 Checksum SHA256 Source Feb 1, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting