@classmethod
    def get_foreign_keys(cls):
        foreign_keys = {}
        for field in cls._meta.fields:
            if (
                field.get_internal_type() == 'ForeignKey' and
                field.name != 'parent'
            ):
                foreign_keys[field.name] = field.rel.to
        return foreign_keys
Get foreign keys and models they refer to, so we can pre-process
dataset/ETHPy150Open tabo/django-treebeard/treebeard/models.py/Node.get_foreign_keys