code: 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
docs: Gather the keys from a list of related models.
  
          :type models: list
  
          :rtype: list