diff options
| author | Tom Christie | 2011-01-28 09:14:04 +0000 |
|---|---|---|
| committer | Tom Christie | 2011-01-28 09:14:04 +0000 |
| commit | 2e9fd9c6b93a77dcf5caa42a4d71b9da2021693f (patch) | |
| tree | 22f9d6e6e6dba501ee1aadecadf324d39524dad4 /examples/pygments_api | |
| parent | 8e8547ff9a0a77f39f0ec46dcc0772706ff9371f (diff) | |
| download | django-rest-framework-2e9fd9c6b93a77dcf5caa42a4d71b9da2021693f.tar.bz2 | |
Minor fixups on pygments example
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 01f1b4b6..02f541f3 100644 --- a/examples/pygments_api/views.py +++ b/examples/pygments_api/views.py @@ -38,15 +38,15 @@ class PygmentsRoot(Resource): if not os.path.exists(pathname): # We only need to generate the file if it doesn't already exist. - title = content['title'] if content['title'] else None + options = {'title': content['title']} if content['title'] else {} linenos = 'table' if content['linenos'] else False lexer = get_lexer_by_name(content['lexer']) - formatter = HtmlFormatter(style=content['style'], linenos=linenos, full=True, title=title) + formatter = HtmlFormatter(style=content['style'], linenos=linenos, full=True, **options) with open(pathname, 'w') as outfile: highlight(content['code'], lexer, formatter, outfile) - return Response(status.HTTP_303_SEE_OTHER, headers={'Location': self.reverse(PygmentsInstance, unique_id)}) + return Response(status.HTTP_201_CREATED, headers={'Location': self.reverse(PygmentsInstance, unique_id)}) class PygmentsInstance(Resource): |
