diff options
| author | Sébastien Piquemal | 2012-02-07 16:52:15 +0200 |
|---|---|---|
| committer | Sébastien Piquemal | 2012-02-07 16:52:15 +0200 |
| commit | 2cdff1b01e3aca6c56cef433e786e3ae75362739 (patch) | |
| tree | c44ccbd8b16a85aab0ef18e36aa5af8846bd3062 /examples/resourceexample/views.py | |
| parent | 6963fd3623ee217fe489abb25f0ffa8c0781e4cd (diff) | |
| download | django-rest-framework-2cdff1b01e3aca6c56cef433e786e3ae75362739.tar.bz2 | |
modified examples, somethin' still broken, can't find what
Diffstat (limited to 'examples/resourceexample/views.py')
| -rw-r--r-- | examples/resourceexample/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/resourceexample/views.py b/examples/resourceexample/views.py index e6b5eeb8..44c4176a 100644 --- a/examples/resourceexample/views.py +++ b/examples/resourceexample/views.py @@ -16,12 +16,12 @@ 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 Response({"Some other resources": [reverse('another-example', kwargs={'num':num}) for num in range(3)]}) class AnotherExampleView(View): """ - A basic view, that can be handle GET and POST requests. + A basic view, that can handle GET and POST requests. Applies some simple form validation on POST requests. """ form = MyForm @@ -33,7 +33,7 @@ class AnotherExampleView(View): """ if int(num) > 2: return Response(status.HTTP_404_NOT_FOUND) - return "GET request to AnotherExampleResource %s" % num + return Response("GET request to AnotherExampleResource %s" % num) def post(self, request, num): """ @@ -42,4 +42,4 @@ class AnotherExampleView(View): """ if int(num) > 2: return Response(status.HTTP_404_NOT_FOUND) - return "POST request to AnotherExampleResource %s, with content: %s" % (num, repr(self.CONTENT)) + return Response("POST request to AnotherExampleResource %s, with content: %s" % (num, repr(self.CONTENT))) |
