This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=None, keep_old=False): | |
""" | |
Use this function to merge model objects (i.e. Users, Organizations, Polls, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import os | |
import time | |
def cls(): | |
os.system(['clear', 'cls'][os.name == 'nt']) | |
figure_repos = '.o.' |