def get_related_ids(self):
        related = self.get_related()

        full_key = related.get_qualified_key_name()

        return self.get_query().select(full_key).lists(related.get_key_name())
Get all of the IDs for the related models.
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to_many.py/BelongsToMany.get_related_ids