pagination - fix file formatting

This commit is contained in:
Dmitrij Strelnikov 2016-02-09 17:14:21 +01:00
parent 4811cc7ab9
commit e84325b3fb

View File

@ -4,14 +4,17 @@ Pagination serializers determine the structure of the output that should
be used for paginated responses. be used for paginated responses.
""" """
from __future__ import unicode_literals from __future__ import unicode_literals
from base64 import b64decode, b64encode from base64 import b64decode, b64encode
from collections import OrderedDict, namedtuple from collections import OrderedDict, namedtuple
from django.core.paginator import Paginator as DjangoPaginator from django.core.paginator import Paginator as DjangoPaginator
from django.core.paginator import InvalidPage from django.core.paginator import InvalidPage
from django.template import loader from django.template import loader
from django.utils import six from django.utils import six
from django.utils.six.moves.urllib import parse as urlparse from django.utils.six.moves.urllib import parse as urlparse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from rest_framework.compat import template_render from rest_framework.compat import template_render
from rest_framework.exceptions import NotFound from rest_framework.exceptions import NotFound
from rest_framework.response import Response from rest_framework.response import Response
@ -126,7 +129,6 @@ def _reverse_ordering(ordering_tuple):
Given an order_by tuple such as `('-created', 'uuid')` reverse the Given an order_by tuple such as `('-created', 'uuid')` reverse the
ordering and return a new tuple, eg. `('created', '-uuid')`. ordering and return a new tuple, eg. `('created', '-uuid')`.
""" """
def invert(x): def invert(x):
return x[1:] if (x.startswith('-')) else '-' + x return x[1:] if (x.startswith('-')) else '-' + x