def get_field(self):
    try:
        field = self.REQUEST['sort']
    except (KeyError, ValueError, __HOLE__):
        field = ''
    return (self.direction == 'desc' and '-' or '') + field
dataset/ETHPy150Open directeur/django-sorting/django_sorting/middleware.py/get_field