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

Overview

Django-transplant is an app for performing easy merges of django user accounts. It should play nicely with any third party social authentication backend.

Requirements

Django-transplant requires:

  • Django 1.2.5 or higher.

If you plan to develop, or run the test suite you should also install:

  • Mock

This dependency will not be installed automatically via pip.

Installing

To install with pip into site-packages issue:

pip install django-transplant

To install with pip into src folder (as git repo) issue:

pip install -e \
git+http://github.com/lolek09/django-transplant#egg=django-transplant

Configuration

Add 'transplant' to your INSTALLED_APPS. If you plan to run the test suite you should also add 'transplant.tests':

INSTALLED_APPS += (
        'transplant',
        'transplant.tests', # this is optional
)

For your convenience django-transplant provides a default view for performing User merges. You can use it like any FormView, and it’s name is transplant_merge. It expects a default template in ‘transplant/merge.html’.

To hook it up just add it to your urlconf at any URL:

urplatterns = patterns('',
        ...
        url(r'^accounts/merge/$', include('transplant.urls')),
        ...
)

You should be now able to get the merge form and submit it, but it will have no effect. To utilize default merges you must set TRANSPLANT_OPERATIONS in your settings.py:

TRANSPLANT_OPERATIONS = (
    (
        'transplant.tests.models.CustomProfile',
        'transplant.surgeons.DefaultSurgeon',
        {}
    ),
    (
        'transplant.tests.models.Item',
        'transplant.tests.surgeons.DefaultSurgeon',
        {'user_field': 'owner'}
    ),
    (
        'transplant.tests.models.Message',
        'transplant.tests.surgeons.DefaultSurgeon',
        {'manager': 'unread'}
    ),
)

TRANSPLANT_OPERATIONS consists of triples, each one of them specifies:

  1. Path to model class to be merged.
  2. Path to Surgeon class to be used during the merge.
  3. Extra arguments.

Currently supported extra arguments are:

  • user_field - name of the user field that will be used by the Surgeon during the merge (defaults to ‘user’).
  • manager - name of Manager used during the merge. In the example above only messages accessible via the ‘unread’ manager will be merged.

You may be happy with the behavior of DefaultSurgeon which is:

  • set field given as ‘user_field’ to the user that performs the merge
  • call save() on each entity (so that all signals are triggered)
  • set the is_active to False on the user that is merged

If you want additional functionality consult the docs.

Documentation

Documentation is available at http://django-transplant.readthedocs.org/

Changelog

0.0.2

  • Addidional Surgeon class BatchSurgeon pefrorming batch updates
  • Added UserMergeForm used by default by provided view

0.0.1

  • Surgery class
  • Surgeon classes - NopSurgeon class that does basically nothing - DefaultSurgeon class for default merging behavior
  • Default view provide for convenience
  • Urls provided for conveniene
Release History

Release History

0.0.2

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.0.1

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
django-transplant-0.0.2.tar.gz (9.4 kB) Copy SHA256 Checksum SHA256 Source Jun 21, 2012

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