Ticket #14745: fix-shortcut-docs.diff

File fix-shortcut-docs.diff, 3.9 KB (added by Adam Vandenberg, 14 years ago)
  • docs/topics/http/shortcuts.txt

    diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt
    index 6bd3058..a04ffae 100644
    a b Optional arguments  
    3636
    3737``context_instance``
    3838    The context instance to render the template with. By default, the template
    39     will be rendered with a ``Context`` instance (filled with values from
    40     ``dictionary``). If you need to use :ref:`context processors
    41     <subclassing-context-requestcontext>`, render the template with a
    42     ``RequestContext`` instance instead. Your code might look something like
    43     this::
     39    will be rendered with a :class:`~django.template.Context` instance (filled
     40    with values from ``dictionary``). If you need to use :ref:`context
     41    processors <subclassing-context-requestcontext>`, render the template with
     42    a :class:`~django.template.RequestContext` instance instead. Your code
     43    might look something like this::
    4444
    4545        return render_to_response('my_template.html',
    4646                                  my_data_dictionary,
    4747                                  context_instance=RequestContext(request))
    4848
    4949``mimetype``
    50 
    51     .. versionadded:: 1.0
    52 
    5350    The MIME type to use for the resulting document. Defaults to the value of
    5451    the :setting:`DEFAULT_CONTENT_TYPE` setting.
    5552
     53.. versionadded:: 1.0
     54
     55
    5656Example
    5757-------
    5858
    This example is equivalent to::  
    8585
    8686   .. versionadded:: 1.1
    8787
    88    Returns an HttpResponseRedirect to the apropriate URL for the arguments
    89    passed.
     88   Returns an :class:`~django.http.HttpResponseRedirect` to the apropriate URL
     89   for the arguments passed.
    9090
    9191   The arguments could be:
    9292
    This example is equivalent to::  
    9797
    9898       * A URL, which will be used as-is for the redirect location.
    9999
    100    By default issues a temporary redirect; pass permanent=True to issue a
     100   By default issues a temporary redirect; pass ``permanent=True`` to issue a
    101101   permanent redirect
    102102
    103103Examples
    will be returned::  
    149149.. function:: get_object_or_404(klass, *args, **kwargs)
    150150
    151151   Calls :meth:`~django.db.models.QuerySet.get()` on a given model manager,
    152    but it raises ``django.http.Http404`` instead of the model's
    153    ``DoesNotExist`` exception.
     152   but it raises :class:`~django.http.Http404` instead of the model's
     153   :class:`~django.core.exceptions.DoesNotExist` exception.
    154154
    155155Required arguments
    156156------------------
    157157
    158158``klass``
    159     A ``Model``, ``Manager`` or ``QuerySet`` instance from which to get the
     159    A :class:`~django.db.models.Model`, :class:`~django.db.models.Manager` or
     160    :class:`~django.db.models.query.QuerySet` instance from which to get the
    160161    object.
    161162
    162163``**kwargs``
    This example is equivalent to::  
    184185        except MyModel.DoesNotExist:
    185186            raise Http404
    186187
    187 Note: As with ``get()``, an ``MultipleObjectsReturned`` exception will be
    188 raised if more than one object is found.
     188Note: As with ``get()``, a
     189:class:`~django.core.exceptions.MultipleObjectsReturned` exception
     190will be raised if more than one object is found.
    189191
    190192``get_list_or_404``
    191193===================
    raised if more than one object is found.  
    193195.. function:: get_list_or_404(klass, *args, **kwargs)
    194196
    195197   Returns the result of :meth:`~django.db.models.QuerySet.filter()` on a
    196    given model manager, raising ``django.http.Http404`` if the resulting list
    197    is empty.
     198   given model manager, raising :class:`~django.http.Http404` if the resulting
     199   list is empty.
    198200
    199201Required arguments
    200202------------------
    201203
    202204``klass``
    203     A ``Model``, ``Manager`` or ``QuerySet`` instance from which to get the
    204     object.
     205    A :class:`~django.db.models.Model`, :class:`~django.db.models.Manager` or
     206    :class:`~django.db.models.query.QuerySet` instance from which to get the
     207    list.
    205208
    206209``**kwargs``
    207210    Lookup parameters, which should be in the format accepted by ``get()`` and
Back to Top