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.conf import settings | |
from django.db.models.deletion import Collector | |
from django.db.utils import ConnectionRouter | |
def deletable_objects(obj): | |
""" | |
Return a generator that yields (model, instance) tuples | |
of instances related to obj (including obj itself). | |
Essentially, programmatic access to the data Django Admin |