code: def distinct_on(self, value):
          
          if isinstance(value, str):
              value = [value]
          self._distinct_on[:] = value
docs: Set fields used to group query results.
  
          :type value: str or sequence of strings
          :param value: Each value is a string giving the name of a
                        property to use to group results together.