aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pygments_api/views.py
diff options
context:
space:
mode:
authorTom Christie2011-05-24 10:27:24 +0100
committerTom Christie2011-05-24 10:27:24 +0100
commit370274f5640d55ef71422f7a2440710a43ff900e (patch)
tree2b970d3e1ad6d283050139bfe7a914bf10586963 /examples/pygments_api/views.py
parent698df527a3b80edbf4278ea52e88c1699b2f2256 (diff)
downloaddjango-rest-framework-370274f5640d55ef71422f7a2440710a43ff900e.tar.bz2
Allow views to return HttpResponses. Add initial() hook method
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 e6bfae48..76647107 100644
--- a/examples/pygments_api/views.py
+++ b/examples/pygments_api/views.py
@@ -5,7 +5,7 @@ from django.core.urlresolvers import reverse
from djangorestframework.resources import FormResource
from djangorestframework.response import Response
from djangorestframework.renderers import BaseRenderer
-from djangorestframework.views import BaseView
+from djangorestframework.views import View
from djangorestframework import status
from pygments.formatters import HtmlFormatter
@@ -53,7 +53,7 @@ class PygmentsFormResource(FormResource):
form = PygmentsForm
-class PygmentsRoot(BaseView):
+class PygmentsRoot(View):
"""
This example demonstrates a simple RESTful Web API aound the awesome pygments library.
This top level resource is used to create highlighted code snippets, and to list all the existing code snippets.
@@ -88,7 +88,7 @@ class PygmentsRoot(BaseView):
return Response(status.HTTP_201_CREATED, headers={'Location': reverse('pygments-instance', args=[unique_id])})
-class PygmentsInstance(BaseView):
+class PygmentsInstance(View):
"""
Simply return the stored highlighted HTML file with the correct mime type.
This Resource only renders HTML and uses a standard HTML renderer rather than the renderers.DocumentingHTMLRenderer class.