Created
February 2, 2016 16:23
-
-
Save charettes/e4e650eecaf3f5fc58d3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 router | |
from django.db.models import deletion | |
def ALLOW_MIGRATE_CASCADE(collector, field, sub_objs, using): | |
opts = sub_objs[0]._meta | |
if router.allow_migrate(using, opts.app_label, opts.model_name): | |
deletion.CASCADE(collector, field, sub_objs, using) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment