aboutsummaryrefslogtreecommitdiffstats
path: root/examples/resourceexample/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/resourceexample/views.py')
-rw-r--r--examples/resourceexample/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/resourceexample/views.py b/examples/resourceexample/views.py
index e5bb5efa..c4462ee2 100644
--- a/examples/resourceexample/views.py
+++ b/examples/resourceexample/views.py
@@ -1,13 +1,14 @@
+from django.core.urlresolvers import reverse
from djangorestframework.resource import Resource
from djangorestframework.response import Response, status
from resourceexample.forms import MyForm
class ExampleResource(Resource):
- """A basic read only resource that points to 3 other resources."""
+ """A basic read-only resource that points to 3 other resources."""
allowed_methods = anon_allowed_methods = ('GET',)
def get(self, request, auth):
- return {"Some other resources": [self.reverse(AnotherExampleResource, num=num) for num in range(3)]}
+ return {"Some other resources": [reverse('another-example-resource', kwargs={'num':num}) for num in range(3)]}
class AnotherExampleResource(Resource):
"""A basic GET-able/POST-able resource."""