From 193af483efca2aaaebc186301b88f5735c87e638 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 13 Dec 2013 20:22:56 +0000 Subject: [PATCH] Add notes on lookup_prefix argument and why it's there even though unused by the default implementations. --- rest_framework/routers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rest_framework/routers.py b/rest_framework/routers.py index 7915991d9..97b35c10a 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}>[^/]+)'