Created
February 2, 2016 16:23
-
-
Save charettes/e4e650eecaf3f5fc58d3 to your computer and use it in GitHub Desktop.
Revisions
-
charettes created this gist
Feb 2, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ 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)