mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
fixed blank lines
This commit is contained in:
parent
ff28ac995e
commit
ea44238b71
|
@ -132,7 +132,6 @@ class NamespaceVersioning(BaseVersioning):
|
||||||
|
|
||||||
|
|
||||||
class MultipleNamespaceVersioning(NamespaceVersioning):
|
class MultipleNamespaceVersioning(NamespaceVersioning):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This is the same as NamespaceVersioning, the difference is that
|
This is the same as NamespaceVersioning, the difference is that
|
||||||
multiple namespaces can be used for bigger projects.
|
multiple namespaces can be used for bigger projects.
|
||||||
|
@ -168,13 +167,11 @@ class MultipleNamespaceVersioning(NamespaceVersioning):
|
||||||
{% url 'json:items:detail' pk=2 }
|
{% url 'json:items:detail' pk=2 }
|
||||||
--> /json/items/2/
|
--> /json/items/2/
|
||||||
|
|
||||||
|
|
||||||
allowed versions must be set as it will be used to compare its
|
allowed versions must be set as it will be used to compare its
|
||||||
contents with the given namespaces of the url
|
contents with the given namespaces of the url
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def determine_version(self, request, *args, **kwargs):
|
def determine_version(self, request, *args, **kwargs):
|
||||||
|
|
||||||
resolver_match = getattr(request, 'resolver_match', None)
|
resolver_match = getattr(request, 'resolver_match', None)
|
||||||
version = None
|
version = None
|
||||||
|
|
||||||
|
@ -187,10 +184,8 @@ class MultipleNamespaceVersioning(NamespaceVersioning):
|
||||||
for namespace in resolver_match.namespaces:
|
for namespace in resolver_match.namespaces:
|
||||||
if namespace in self.allowed_versions:
|
if namespace in self.allowed_versions:
|
||||||
version = namespace
|
version = namespace
|
||||||
|
|
||||||
if version is None:
|
if version is None:
|
||||||
version = self.default_version
|
version = self.default_version
|
||||||
|
|
||||||
return version
|
return version
|
||||||
|
|
||||||
def reverse(self, viewname, args=None, kwargs=None, request=None, format=None, **extra):
|
def reverse(self, viewname, args=None, kwargs=None, request=None, format=None, **extra):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user