diff options
| author | Tom Christie | 2013-12-13 20:22:56 +0000 | 
|---|---|---|
| committer | Tom Christie | 2013-12-13 20:22:56 +0000 | 
| commit | 193af483efca2aaaebc186301b88f5735c87e638 (patch) | |
| tree | c91903c537674b78b7b8238bfffa8e28f422c606 /rest_framework/routers.py | |
| parent | fbaba0a309d7ead47e4ec2290a69604a8f039bda (diff) | |
| download | django-rest-framework-193af483efca2aaaebc186301b88f5735c87e638.tar.bz2 | |
Add notes on lookup_prefix argument and why it's there even though unused by the default implementations.
Diffstat (limited to 'rest_framework/routers.py')
| -rw-r--r-- | rest_framework/routers.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/rest_framework/routers.py b/rest_framework/routers.py index 7915991d..97b35c10 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -188,6 +188,12 @@ class SimpleRouter(BaseRouter):          """          Given a viewset, return the portion of URL regex that is used          to match against a single instance. + +        Note that lookup_prefix is not used directly inside REST rest_framework +        itself, but is required in order to nicely support nested router +        implementations, such as drf-nested-routers. + +        https://github.com/alanjds/drf-nested-routers          """          if self.trailing_slash:              base_regex = '(?P<{lookup_prefix}{lookup_field}>[^/]+)' | 
