def _get_eager_model_keys(self, models):
        keys = []

        for model in models:
            value = getattr(model, self._foreign_key)

            if value is not None and value not in keys:
                keys.append(value)

        if not len(keys):
            return [0]

        return keys
Gather the keys from a list of related models.
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to.py/BelongsTo._get_eager_model_keys