diff options
| author | Tom Christie | 2015-03-16 11:57:42 +0000 | 
|---|---|---|
| committer | Tom Christie | 2015-03-16 11:57:42 +0000 | 
| commit | 4cd49d5de38b860e4b2260d7fa82dbdf9256c6e8 (patch) | |
| tree | 139e2ae4df198e3d672e7b47ef875e48cf1311da /rest_framework | |
| parent | c573e7b4a8b4fedfe70b934571284d84e9a81103 (diff) | |
| parent | 1c0db6dda8235bc0bfab2370ea6c6d0fd08a1da5 (diff) | |
| download | django-rest-framework-4cd49d5de38b860e4b2260d7fa82dbdf9256c6e8.tar.bz2 | |
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/pagination.py | 2 | ||||
| -rw-r--r-- | rest_framework/routers.py | 5 | ||||
| -rw-r--r-- | rest_framework/templates/rest_framework/pagination/previous_and_next.html | 2 | 
3 files changed, 5 insertions, 4 deletions
| diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index f41a9ae1..5e60448d 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -10,7 +10,7 @@ from django.core.paginator import InvalidPage, Paginator as DjangoPaginator  from django.template import Context, loader  from django.utils import six  from django.utils.six.moves.urllib import parse as urlparse -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _  from rest_framework.compat import OrderedDict  from rest_framework.exceptions import NotFound  from rest_framework.response import Response diff --git a/rest_framework/routers.py b/rest_framework/routers.py index b1e39ff7..4df852bf 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -218,14 +218,15 @@ class SimpleRouter(BaseRouter):          https://github.com/alanjds/drf-nested-routers          """ -        base_regex = '(?P<{lookup_prefix}{lookup_field}>{lookup_value})' +        base_regex = '(?P<{lookup_prefix}{lookup_url_kwarg}>{lookup_value})'          # Use `pk` as default field, unset set.  Default regex should not          # consume `.json` style suffixes and should break at '/' boundaries.          lookup_field = getattr(viewset, 'lookup_field', 'pk') +        lookup_url_kwarg = getattr(viewset, 'lookup_url_kwarg', None) or lookup_field          lookup_value = getattr(viewset, 'lookup_value_regex', '[^/.]+')          return base_regex.format(              lookup_prefix=lookup_prefix, -            lookup_field=lookup_field, +            lookup_url_kwarg=lookup_url_kwarg,              lookup_value=lookup_value          ) diff --git a/rest_framework/templates/rest_framework/pagination/previous_and_next.html b/rest_framework/templates/rest_framework/pagination/previous_and_next.html index eacbfff4..08c17709 100644 --- a/rest_framework/templates/rest_framework/pagination/previous_and_next.html +++ b/rest_framework/templates/rest_framework/pagination/previous_and_next.html @@ -7,6 +7,6 @@  {% if next_url %}      <li class="next"><a href="{{ next_url }}">Next »</a></li>  {% else %} -    <li class="next disabled"><a href="#">Next »</li> +    <li class="next disabled"><a href="#">Next »</a></li>  {% endif %}  </ul> | 
