diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2011-10-14 00:12:01 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2011-10-14 00:12:01 +0000 |
| commit | d1e5c55258d624058a93c8cacdb1f25ae7857554 (patch) | |
| tree | dca859edc2229f68b7511687aa8b333378786633 /docs/howto/outputting-csv.txt | |
| parent | 5109ac370928a5924887424b6d6c803038fcb691 (diff) | |
Fixed many more ReST indentation errors, somehow accidentally missed from [16955]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/howto/outputting-csv.txt')
| -rw-r--r-- | docs/howto/outputting-csv.txt | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/docs/howto/outputting-csv.txt b/docs/howto/outputting-csv.txt index 3e3d7d47ff..1a606069b8 100644 --- a/docs/howto/outputting-csv.txt +++ b/docs/howto/outputting-csv.txt @@ -32,27 +32,27 @@ Here's an example:: The code and comments should be self-explanatory, but a few things deserve a mention: - * The response gets a special MIME type, :mimetype:`text/csv`. This tells - browsers that the document is a CSV file, rather than an HTML file. If - you leave this off, browsers will probably interpret the output as HTML, - which will result in ugly, scary gobbledygook in the browser window. +* The response gets a special MIME type, :mimetype:`text/csv`. This tells + browsers that the document is a CSV file, rather than an HTML file. If + you leave this off, browsers will probably interpret the output as HTML, + which will result in ugly, scary gobbledygook in the browser window. - * The response gets an additional ``Content-Disposition`` header, which - contains the name of the CSV file. This filename is arbitrary; call it - whatever you want. It'll be used by browsers in the "Save as..." - dialogue, etc. +* The response gets an additional ``Content-Disposition`` header, which + contains the name of the CSV file. This filename is arbitrary; call it + whatever you want. It'll be used by browsers in the "Save as..." + dialogue, etc. - * Hooking into the CSV-generation API is easy: Just pass ``response`` as the - first argument to ``csv.writer``. The ``csv.writer`` function expects a - file-like object, and :class:`~django.http.HttpResponse` objects fit the - bill. +* Hooking into the CSV-generation API is easy: Just pass ``response`` as the + first argument to ``csv.writer``. The ``csv.writer`` function expects a + file-like object, and :class:`~django.http.HttpResponse` objects fit the + bill. - * For each row in your CSV file, call ``writer.writerow``, passing it an - iterable object such as a list or tuple. +* For each row in your CSV file, call ``writer.writerow``, passing it an + iterable object such as a list or tuple. - * The CSV module takes care of quoting for you, so you don't have to worry - about escaping strings with quotes or commas in them. Just pass - ``writerow()`` your raw strings, and it'll do the right thing. +* The CSV module takes care of quoting for you, so you don't have to worry + about escaping strings with quotes or commas in them. Just pass + ``writerow()`` your raw strings, and it'll do the right thing. Handling Unicode ~~~~~~~~~~~~~~~~ @@ -62,13 +62,13 @@ Unicode internally this means strings read from sources such as :class:`~django.http.HttpRequest` are potentially problematic. There are a few options for handling this: - * Manually encode all Unicode objects to a compatible encoding. +* Manually encode all Unicode objects to a compatible encoding. - * Use the ``UnicodeWriter`` class provided in the `csv module's examples - section`_. +* Use the ``UnicodeWriter`` class provided in the `csv module's examples + section`_. - * Use the `python-unicodecsv module`_, which aims to be a drop-in - replacement for :mod:`csv` that gracefully handles Unicode. +* Use the `python-unicodecsv module`_, which aims to be a drop-in + replacement for :mod:`csv` that gracefully handles Unicode. For more information, see the Python documentation of the :mod:`csv` module. |
