def uncopy_regulations(apps, schema_editor):
    Regulation = apps.get_model('regcore', 'Regulation')
    Document = apps.get_model('regcore', 'Document')
    for doc in Document.objects.filter(doc_type='cfr'):
        data = {field.name: getattr(doc, field.name) for field in Regulation._meta.fields if (field.name not in {'parent'})}
        reg = Regulation(**data)
        reg.parent_id = doc.parent_id
        reg.save()
def uncopy_regulations(apps, schema_editor):
    Regulation = apps.get_model('regcore', 'Regulation')
    Document = apps.get_model('regcore', 'Document')
    for doc in Document.objects.filter(doc_type='cfr'):
        data = {field.name: getattr(doc, field.name) for field in Regulation._meta.fields if (field.name not in {'parent'})}
        reg = Regulation(**data)
        reg.parent_id = doc.parent_id
        reg.save()