I hereby claim:
- I am aaronkeck on github.
- I am akeck (https://keybase.io/akeck) on keybase.
- I have a public key ASDZN38lWwK_P-Wa-JsDRZpH-AYod7_h3I4pGpZk4NYw5wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| from django.db import transaction | |
| from django.db.models import Model | |
| from django.contrib.contenttypes.generic import GenericForeignKey | |
| from django.apps import apps | |
| @transaction.atomic | |
| def merge_model_objects(primary_object, alias_objects=[], keep_old=False): | |
| """ | |
| Use this function to merge model objects (i.e. Users, Organizations, Polls, | |
| etc.) and migrate all of the related fields from the alias objects to the |