How can I get a list of all the model objects that have a ForeignKey pointing to an object? (Something like the delete confirmation page in the Django admin before DELETE C
The following is what django uses to get all related objects
from django.db.models.deletion import Collector collector = Collector(using="default") collector.collect([a]) print collector.data