Ticket #14746: http-doc-fixes.diff

File http-doc-fixes.diff, 5.6 KB (added by Adam Vandenberg, 14 years ago)
  • docs/ref/request-response.txt

    diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
    index 7f2284f..dc79097 100644
    a b All attributes except ``session`` should be considered read-only.  
    6565    .. versionadded:: 1.0
    6666
    6767    A string representing the current encoding used to decode form submission
    68     data (or ``None``, which means the ``DEFAULT_CHARSET`` setting is used).
    69     You can write to this attribute to change the encoding used when accessing
    70     the form data. Any subsequent attribute accesses (such as reading from
    71     ``GET`` or ``POST``) will use the new ``encoding`` value.  Useful if you
    72     know the form data is not in the ``DEFAULT_CHARSET`` encoding.
     68    data (or ``None``, which means the :setting:`DEFAULT_CHARSET` setting is
     69    used). You can write to this attribute to change the encoding used when
     70    accessing the form data. Any subsequent attribute accesses (such as reading
     71    from ``GET`` or ``POST``) will use the new ``encoding`` value.  Useful if
     72    you know the form data is not in the :setting:`DEFAULT_CHARSET` encoding.
    7373
    7474.. attribute:: HttpRequest.GET
    7575
    7676    A dictionary-like object containing all given HTTP GET parameters. See the
    77     ``QueryDict`` documentation below.
     77    :class:`QueryDict` documentation below.
    7878
    7979.. attribute:: HttpRequest.POST
    8080
    8181    A dictionary-like object containing all given HTTP POST parameters. See the
    82     ``QueryDict`` documentation below.
     82    :class:`QueryDict` documentation below.
    8383
    8484    It's possible that a request can come in via POST with an empty ``POST``
    8585    dictionary -- if, say, a form is requested via the POST HTTP method but
    All attributes except ``session`` should be considered read-only.  
    110110
    111111    A dictionary-like object containing all uploaded files. Each key in
    112112    ``FILES`` is the ``name`` from the ``<input type="file" name="" />``. Each
    113     value in ``FILES`` is an ``UploadedFile`` object containing the following
    114     attributes:
    115 
    116         * ``read(num_bytes=None)`` -- Read a number of bytes from the file.
    117         * ``name`` -- The name of the uploaded file.
    118         * ``size`` -- The size, in bytes, of the uploaded file.
    119         * ``chunks(chunk_size=None)`` -- A generator that yields sequential
    120           chunks of data.
     113    value in ``FILES`` is an :class:`UploadedFile` as described below.
    121114
    122115    See :doc:`/topics/files` for more information.
    123116
    All attributes except ``session`` should be considered read-only.  
    130123
    131124    In previous versions of Django, ``request.FILES`` contained simple ``dict``
    132125    objects representing uploaded files. This is no longer true -- files are
    133     represented by ``UploadedFile`` objects as described below.
     126    represented by :class:`UploadedFile` objects.
    134127
    135     These ``UploadedFile`` objects will emulate the old-style ``dict``
    136     interface, but this is deprecated and will be removed in the next release of
    137     Django.
     128    These :class:`UploadedFile` objects will emulate the old-style ``dict``
     129    interface, but this is deprecated and will be removed in the next release
     130    of Django.
    138131
    139132.. attribute:: HttpRequest.META
    140133
    All attributes except ``session`` should be considered read-only.  
    202195
    203196    Not defined by Django itself, but will be read if other code (e.g., a custom
    204197    middleware class) sets it. When present, this will be used as the root
    205     URLconf for the current request, overriding the ``ROOT_URLCONF`` setting.
    206     See :ref:`how-django-processes-a-request` for details.
     198    URLconf for the current request, overriding the :setting:`ROOT_URLCONF`
     199    setting. See :ref:`how-django-processes-a-request` for details.
    207200
    208201Methods
    209202-------
    Methods  
    300293            process(element)
    301294
    302295
     296UploadedFile objects
     297====================
     298
     299.. class:: UploadedFile
     300
     301
     302Attributes
     303----------
     304
     305.. attribute::  UploadedFile.name
     306
     307    The name of the uploaded file.
     308
     309.. attribute:: UploadedFile.size
     310
     311    The size, in bytes, of the uploaded file.
     312
     313Methods
     314----------
     315
     316.. method:: UploadedFile.chunks(chunk_size=None)
     317
     318    Returns generator that yields sequential chunks of data.
     319
     320.. method:: UploadedFile.read(num_bytes=None)
     321
     322    Read a number of bytes from the file.
     323
     324
     325
    303326QueryDict objects
    304 -----------------
     327=================
    305328
    306329.. class:: QueryDict
    307330
    Django, :class:`HttpResponse` objects are your responsibility. Each view you  
    449472write is responsible for instantiating, populating and returning an
    450473:class:`HttpResponse`.
    451474
    452 The :class:`HttpResponse` class lives in the ``django.http`` module.
     475The :class:`HttpResponse` class lives in the :mod:`django.http` module.
    453476
    454477Usage
    455478-----
    Methods  
    529552.. method:: HttpResponse.__init__(content='', mimetype=None, status=200, content_type=DEFAULT_CONTENT_TYPE)
    530553
    531554    Instantiates an ``HttpResponse`` object with the given page content (a
    532     string) and MIME type. The ``DEFAULT_CONTENT_TYPE`` is ``'text/html'``.
     555    string) and MIME type. The :setting:`DEFAULT_CONTENT_TYPE` is
     556    ``'text/html'``.
    533557
    534558    ``content`` can be an iterator or a string. If it's an iterator, it should
    535559    return strings, and those strings will be joined together to form the
    Methods  
    545569    encoding, which makes it more than just a MIME type specification.
    546570    If ``mimetype`` is specified (not ``None``), that value is used.
    547571    Otherwise, ``content_type`` is used. If neither is given, the
    548     ``DEFAULT_CONTENT_TYPE`` setting is used.
     572    :setting:`DEFAULT_CONTENT_TYPE` setting is used.
    549573
    550574.. method:: HttpResponse.__setitem__(header, value)
    551575
Back to Top