From 13df9dd45e6c23a5d078a49d24884a41aed9930e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20Gr=C3=AAl=C3=A9?= <48758038+AntoninGrele@users.noreply.github.com> Date: Tue, 9 Apr 2019 12:02:59 +0200 Subject: [PATCH] Added a default basename example Attempt to make the default basename attribute easier to understand, by providing an example. --- docs/api-guide/routers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/routers.md b/docs/api-guide/routers.md index 09c6c39cb..ee3aec735 100644 --- a/docs/api-guide/routers.md +++ b/docs/api-guide/routers.md @@ -28,7 +28,7 @@ There are two mandatory arguments to the `register()` method: Optionally, you may also specify an additional argument: -* `basename` - The base to use for the URL names that are created. If unset the basename will be automatically generated based on the `queryset` attribute of the viewset, if it has one. Note that if the viewset does not include a `queryset` attribute then you must set `basename` when registering the viewset. +* `basename` - The base to use for the URL names that are created. If unset the basename will be automatically generated based on the `queryset` attribute of the viewset, if it has one. For example, the queryset `User.objects.all()` will yield `user-list`. Note that if the viewset does not include a `queryset` attribute then you must set `basename` when registering the viewset. The example above would generate the following URL patterns: