Django

Code

Changeset 2784

Show
Ignore:
Timestamp:
04/28/06 20:57:51 (2 years ago)
Author:
adrian
Message:

magic-removal: Proofread docs/outputting_csv.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/docs/outputting_csv.txt

    r1948 r2784  
    5050      browsers that the document is a CSV file, rather than an HTML file. If 
    5151      you leave this off, browsers will probably interpret the output as HTML, 
    52       which would result in ugly, scary gobbledygook in the browser window. 
     52      which will result in ugly, scary gobbledygook in the browser window. 
    5353 
    5454    * The response gets an additional ``Content-Disposition`` header, which 
    55       contains the name of the CSV file. This filename is arbitrary: Call it 
     55      contains the name of the CSV file. This filename is arbitrary; call it 
    5656      whatever you want. It'll be used by browsers in the "Save as..." 
    5757      dialogue, etc. 
     
    9595        ) 
    9696 
    97         t = loader.get_template('my_template_name') 
     97        t = loader.get_template('my_template_name.txt') 
    9898        c = Context({ 
    9999            'data': csv_data, 
     
    106106such as the ``mimetype='text/csv'`` -- is the same. 
    107107 
    108 Then, create the template ``my_template_name``, with this template code:: 
     108Then, create the template ``my_template_name.txt``, with this template code:: 
    109109 
    110110    {% for row in data %}"{{ row.0|addslashes }}", "{{ row.1|addslashes }}", "{{ row.2|addslashes }}", "{{ row.3|addslashes }}", "{{ row.4|addslashes }}"