

def sort(self, keys, direction=None, explicit_nullsfirst=False):
    if direction:
        keys = ((keys, direction),)
    order_bys = []
    for (key, direction) in keys:
        if (direction > 0):
            if explicit_nullsfirst:
                direction = (lambda *args, **kwargs: nullsfirst(asc(*args, **kwargs)))
            else:
                direction = asc
        elif explicit_nullsfirst:
            direction = (lambda *args, **kwargs: nullslast(desc(*args, **kwargs)))
        else:
            direction = desc
        order_bys.append((key, direction))
    self.order_bys = order_bys
    self.objects = None
    return self

dataset/ETHPy150Open adewes/blitzdb/blitzdb/backends/sql/queryset.py QuerySet.sort/original