mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
Merge remote-tracking branch 'origin/nested-routers' into nested-routers
Conflicts: rest_framework/routers.py
This commit is contained in:
commit
a4e4b31bb6
|
@ -189,9 +189,6 @@ class SimpleRouter(BaseRouter):
|
|||
Given a viewset, return the portion of URL regex that is used
|
||||
to match against a single instance.
|
||||
"""
|
||||
if lookup_prefix:
|
||||
lookup_prefix += '_'
|
||||
|
||||
base_regex = '(?P<{lookup_prefix}{lookup_field}>[^/]+)'
|
||||
lookup_field = getattr(viewset, 'lookup_field', 'pk')
|
||||
return base_regex.format(lookup_field=lookup_field, lookup_prefix=lookup_prefix)
|
||||
|
|
Loading…
Reference in New Issue
Block a user