code: def get_id_fields(self):
          
          model = self.get_model()
  
          out = [model._meta.pk.name]  # get PK field name
  
          # If this is being called, it means it
          # is a many-relation  to its parent.
          # Django wants the FK to the parent,
          # but since accurately inferring the FK
          # pointing back to the parent is less than trivial,
          # we will just pull all ID fields.
          # TODO: We also might need to return all non-nullable fields,
          #    or else it is possible Django will issue another request.
          for field in model._meta.fields:
              if isinstance(field, models.ForeignKey):
                  out.append(field.name + '_id')
  
          return out
docs: Called to return a list of fields consisting of, at minimum,
          the PK field name. The output of this method is used to
          construct a Prefetch object with a .only() queryset
          when this field is not being sideloaded but we need to
          return a list of IDs.