def select_related(self, *fields, **kwargs):
        depth = kwargs.pop('depth', 0)
        if kwargs:
            raise TypeError('Unexpected keyword arguments to select_related: %s'
                    % (kwargs.keys(),))
        obj = self._clone()
        if fields:
            if depth:
                raise TypeError('Cannot pass both "depth" and fields to select_related()')
            obj.query.add_select_related(fields)
        else:
            obj.query.select_related = True
        if depth:
            obj.query.max_depth = depth
        return obj
Returns a new QuerySet instance that will select related objects.
dataset/ETHPy150Open charles-vdulac/django-roa/django_roa/db/query.py/RemoteQuerySet.select_related