aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pygments_api/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/pygments_api/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/pygments_api/views.py')
-rw-r--r--examples/pygments_api/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py
index ffea60ae..01710bd5 100644
--- a/examples/pygments_api/views.py
+++ b/examples/pygments_api/views.py
@@ -1,10 +1,10 @@
from __future__ import with_statement # for python 2.5
from django.conf import settings
-from django.core.urlresolvers import reverse
from djangorestframework.resources import FormResource
from djangorestframework.response import Response
from djangorestframework.renderers import BaseRenderer
+from djangorestframework.utils import reverse
from djangorestframework.views import View
from djangorestframework import status
@@ -61,7 +61,7 @@ class PygmentsRoot(View):
Return a list of all currently existing snippets.
"""
unique_ids = [os.path.split(f)[1] for f in list_dir_sorted_by_ctime(HIGHLIGHTED_CODE_DIR)]
- return [reverse('pygments-instance', args=[unique_id]) for unique_id in unique_ids]
+ return [reverse('pygments-instance', request, args=[unique_id]) for unique_id in unique_ids]
def post(self, request):
"""
@@ -81,7 +81,7 @@ class PygmentsRoot(View):
remove_oldest_files(HIGHLIGHTED_CODE_DIR, MAX_FILES)
- return Response(status.HTTP_201_CREATED, headers={'Location': reverse('pygments-instance', args=[unique_id])})
+ return Response(status.HTTP_201_CREATED, headers={'Location': reverse('pygments-instance', request, args=[unique_id])})
class PygmentsInstance(View):