'Django can\'t cascade delete across databases, so we tell it at the model level to
on_delete=DO_NOTHING and then listen for post_delete so we can clean up the CSMHE rows.'

@receiver(post_delete, sender=StudentModule)
def delete_history(sender, instance, **kwargs):

    StudentModuleHistoryExtended.objects.filter(student_module=instance).all().delete()
