Commit ecca5414 authored by Timo Graham's avatar Timo Graham
Browse files

[1.2.X] Fixed #14745 - add links to topics/http/shortucts.txt. thanks adamv for the patch.

Backport of r14835 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14836 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 8f2feb2e
Loading
Loading
Loading
Loading
+20 −18
Original line number Diff line number Diff line
@@ -39,11 +39,11 @@ Optional arguments

``context_instance``
    The context instance to render the template with. By default, the template
    will be rendered with a ``Context`` instance (filled with values from
    ``dictionary``). If you need to use :ref:`context processors
    <subclassing-context-requestcontext>`, render the template with a
    ``RequestContext`` instance instead. Your code might look something like
    this::
    will be rendered with a :class:`~django.template.Context` instance (filled
    with values from ``dictionary``). If you need to use :ref:`context
    processors <subclassing-context-requestcontext>`, render the template with
    a :class:`~django.template.RequestContext` instance instead. Your code
    might look something like this::

        return render_to_response('my_template.html',
                                  my_data_dictionary,
@@ -85,8 +85,8 @@ This example is equivalent to::

   .. versionadded:: 1.1

   Returns an HttpResponseRedirect to the apropriate URL for the arguments
   passed.
   Returns an :class:`~django.http.HttpResponseRedirect` to the appropriate URL
   for the arguments passed.

   The arguments could be:

@@ -97,7 +97,7 @@ This example is equivalent to::

       * A URL, which will be used as-is for the redirect location.

   By default issues a temporary redirect; pass permanent=True to issue a
   By default issues a temporary redirect; pass ``permanent=True`` to issue a
   permanent redirect

Examples
@@ -149,15 +149,15 @@ will be returned::
.. function:: get_object_or_404(klass, *args, **kwargs)

   Calls :meth:`~django.db.models.QuerySet.get()` on a given model manager,
   but it raises ``django.http.Http404`` instead of the model's
   ``DoesNotExist`` exception.
   but it raises :class:`~django.http.Http404` instead of the model's
   :class:`~django.core.exceptions.DoesNotExist` exception.

Required arguments
------------------

``klass``
    A ``Model``, ``Manager`` or ``QuerySet`` instance from which to get the
    object.
    A :class:`~django.db.models.Model`, :class:`~django.db.models.Manager` or
    :class:`~django.db.models.QuerySet` instance from which to get the object.

``**kwargs``
    Lookup parameters, which should be in the format accepted by ``get()`` and
@@ -184,8 +184,9 @@ This example is equivalent to::
        except MyModel.DoesNotExist:
            raise Http404

Note: As with ``get()``, an ``MultipleObjectsReturned`` exception will be
raised if more than one object is found.
Note: As with ``get()``, a
:class:`~django.core.exceptions.MultipleObjectsReturned` exception
will be raised if more than one object is found.

``get_list_or_404``
===================
@@ -193,15 +194,16 @@ raised if more than one object is found.
.. function:: get_list_or_404(klass, *args, **kwargs)

   Returns the result of :meth:`~django.db.models.QuerySet.filter()` on a
   given model manager, raising ``django.http.Http404`` if the resulting list
   is empty.
   given model manager, raising :class:`~django.http.Http404` if the resulting
   list is empty.

Required arguments
------------------

``klass``
    A ``Model``, ``Manager`` or ``QuerySet`` instance from which to get the
    object.
    A :class:`~django.db.models.Model`, :class:`~django.db.models.Manager` or
    :class:`~django.db.models.query.QuerySet` instance from which to get the
    list.

``**kwargs``
    Lookup parameters, which should be in the format accepted by ``get()`` and