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/pygments_api | |
| parent | 6963fd3623ee217fe489abb25f0ffa8c0781e4cd (diff) | |
| download | django-rest-framework-2cdff1b01e3aca6c56cef433e786e3ae75362739.tar.bz2 | |
modified examples, somethin' still broken, can't find what
Diffstat (limited to 'examples/pygments_api')
| -rw-r--r-- | examples/pygments_api/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py index ffea60ae..44dd2caa 100644 --- a/examples/pygments_api/views.py +++ b/examples/pygments_api/views.py @@ -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 Response([reverse('pygments-instance', args=[unique_id]) for unique_id in unique_ids]) def post(self, request): """ @@ -98,7 +98,7 @@ class PygmentsInstance(View): pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id) if not os.path.exists(pathname): return Response(status.HTTP_404_NOT_FOUND) - return open(pathname, 'r').read() + return Response(open(pathname, 'r').read()) def delete(self, request, unique_id): """ @@ -107,5 +107,5 @@ class PygmentsInstance(View): pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id) if not os.path.exists(pathname): return Response(status.HTTP_404_NOT_FOUND) - return os.remove(pathname) + return Response(os.remove(pathname)) |
