Sort the object's values by a criterion produced by an iterator.

def sortBy(self, val=None):
        """ Sort the object's values by a criterion produced by an iterator.
        """
        if val is not None:
            if _(val).isString():
                return self._wrap(sorted(self.obj, key=lambda x,
                                  *args: x.get(val)))
            else:
                return self._wrap(sorted(self.obj, key=val))
        else:
            return self._wrap(sorted(self.obj))