aboutsummaryrefslogtreecommitdiffstats
path: root/examples/resourceexample/views.py
diff options
context:
space:
mode:
authorDaniel Izquierdo2012-02-20 19:28:50 +0900
committerDaniel Izquierdo2012-02-21 22:51:32 +0900
commitc7e7279d979a346b5d1c950cc960183013799c41 (patch)
tree3ebf87d79b2cdd1fcaacc8d328d8fc696f1c5f2f /examples/resourceexample/views.py
parentb600b5075fe766bb6f5d3ac10845f53c789b6139 (diff)
downloaddjango-rest-framework-c7e7279d979a346b5d1c950cc960183013799c41.tar.bz2
Update examples to use the new custom `reverse()'
This fixes #167 except for the docs
Diffstat (limited to 'examples/resourceexample/views.py')
-rw-r--r--examples/resourceexample/views.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/resourceexample/views.py b/examples/resourceexample/views.py
index e6b5eeb8..2f623c39 100644
--- a/examples/resourceexample/views.py
+++ b/examples/resourceexample/views.py
@@ -1,5 +1,4 @@
-from django.core.urlresolvers import reverse
-
+from djangorestframework.utils import reverse
from djangorestframework.views import View
from djangorestframework.response import Response
from djangorestframework import status
@@ -16,7 +15,7 @@ class ExampleView(View):
"""
Handle GET requests, returning a list of URLs pointing to 3 other views.
"""
- return {"Some other resources": [reverse('another-example', kwargs={'num':num}) for num in range(3)]}
+ return {"Some other resources": [reverse('another-example', request, kwargs={'num':num}) for num in range(3)]}
class AnotherExampleView(View):