diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-06-07 17:10:16 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-06-07 17:10:16 +0000 |
| commit | 453d560a945d207013b163228de5ed9a7316a772 (patch) | |
| tree | 380a7c3782cfc9efe46ec8301d21aceff6e0f015 /docs | |
| parent | 0836745c8e850b0bec2df743ff7648ff4cea588e (diff) | |
newforms-admin: Merged from trunk up to [7583].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/db-api.txt | 7 | ||||
| -rw-r--r-- | docs/flatpages.txt | 11 | ||||
| -rw-r--r-- | docs/outputting_pdf.txt | 3 | ||||
| -rw-r--r-- | docs/serialization.txt | 2 | ||||
| -rw-r--r-- | docs/testing.txt | 16 | ||||
| -rw-r--r-- | docs/url_dispatch.txt | 4 |
6 files changed, 33 insertions, 10 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index 405ed87cef..a15c45d37b 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -1061,7 +1061,12 @@ they query the database each time they're called. Returns the object matching the given lookup parameters, which should be in the format described in `Field lookups`_. -``get()`` raises ``AssertionError`` if more than one object was found. +``get()`` raises ``MultipleObjectsReturned`` if more than one object was found. +The ``MultipleObjectsReturned`` exception is an attribute of the model class. +For example, the following will raise ``MultipleObjectsReturned`` if there +are more than one authors with the name of 'John':: + + Author.objects.get(name='John') # raises Author.MultipleObjectsReturned ``get()`` raises a ``DoesNotExist`` exception if an object wasn't found for the given parameters. The ``DoesNotExist`` exception is an attribute of the model diff --git a/docs/flatpages.txt b/docs/flatpages.txt index b6fa8e035f..a538217642 100644 --- a/docs/flatpages.txt +++ b/docs/flatpages.txt @@ -66,6 +66,17 @@ resort. For more on middleware, read the `middleware docs`_. +.. admonition:: Ensure that your 404 template works + + Note that the ``FlatpageFallbackMiddleware`` only steps in once + another view has successfully produced a 404 response. If another + view or middleware class attempts to produce a 404 but ends up + raising an exception instead (such as a ``TemplateDoesNotExist`` + exception if your site does not have an appropriate template to + use for HTTP 404 responses), the response will become an HTTP 500 + ("Internal Server Error") and the ``FlatpageFallbackMiddleware`` + will not attempt to serve a flat page. + .. _SITE_ID: ../settings/#site-id .. _RequestContext: ../templates_python/#subclassing-context-djangocontext .. _middleware docs: ../middleware/ diff --git a/docs/outputting_pdf.txt b/docs/outputting_pdf.txt index bd6ae7a660..dd8a262812 100644 --- a/docs/outputting_pdf.txt +++ b/docs/outputting_pdf.txt @@ -143,11 +143,14 @@ Further resources * PDFlib_ is another PDF-generation library that has Python bindings. To use it with Django, just use the same concepts explained in this article. + * `Pisa HTML2PDF`_ is yet another PDF-generation library. Pisa ships with + an example of how to integrate Pisa with Django. * HTMLdoc_ is a command-line script that can convert HTML to PDF. It doesn't have a Python interface, but you can escape out to the shell using ``system`` or ``popen`` and retrieve the output in Python. * `forge_fdf in Python`_ is a library that fills in PDF forms. .. _PDFlib: http://www.pdflib.org/ +.. _`Pisa HTML2PDF`: http://www.htmltopdf.org/ .. _HTMLdoc: http://www.htmldoc.org/ .. _forge_fdf in Python: http://www.accesspdf.com/article.php/20050421092951834 diff --git a/docs/serialization.txt b/docs/serialization.txt index e901410f1c..8a672d8b8a 100644 --- a/docs/serialization.txt +++ b/docs/serialization.txt @@ -112,7 +112,7 @@ Django "ships" with a few included serializers: strings, etc.). Not really all that useful on its own, but used as a base for other serializers. - ``yaml`` Serializes to YAML (Yet Another Markup Lanuage). This + ``yaml`` Serializes to YAML (YAML Ain't a Markup Language). This serializer is only available if PyYAML_ is installed. ========== ============================================================== diff --git a/docs/testing.txt b/docs/testing.txt index 0ff3cce3d9..befa6979af 100644 --- a/docs/testing.txt +++ b/docs/testing.txt @@ -822,6 +822,10 @@ useful for testing Web applications: that ``text`` appears in the content of the response. If ``count`` is provided, ``text`` must occur exactly ``count`` times in the response. +``assertNotContains(response, text, status_code=200)`` + Asserts that a ``Response`` instance produced the given ``status_code`` and + that ``text`` does not appears in the content of the response. + ``assertFormError(response, form, field, errors)`` Asserts that a field on a form raises the provided list of errors when rendered on the form. @@ -837,6 +841,12 @@ useful for testing Web applications: ``errors`` is an error string, or a list of error strings, that are expected as a result of form validation. +``assertTemplateUsed(response, template_name)`` + Asserts that the template with the given name was used in rendering the + response. + + The name is a string such as ``'admin/index.html'``. + ``assertTemplateNotUsed(response, template_name)`` Asserts that the template with the given name was *not* used in rendering the response. @@ -846,12 +856,6 @@ useful for testing Web applications: it redirected to ``expected_url`` (including any GET data), and the subsequent page was received with ``target_status_code``. -``assertTemplateUsed(response, template_name)`` - Asserts that the template with the given name was used in rendering the - response. - - The name is a string such as ``'admin/index.html'``. - E-mail services --------------- diff --git a/docs/url_dispatch.txt b/docs/url_dispatch.txt index 28f15289a9..7d67cd5b53 100644 --- a/docs/url_dispatch.txt +++ b/docs/url_dispatch.txt @@ -157,10 +157,10 @@ The URLconf searches against the requested URL, as a normal Python string. This does not include GET or POST parameters, or the domain name. For example, in a request to ``http://www.example.com/myapp/``, the URLconf -will look for ``/myapp/``. +will look for ``myapp/``. In a request to ``http://www.example.com/myapp/?page=3``, the URLconf will look -for ``/myapp/``. +for ``myapp/``. The URLconf doesn't look at the request method. In other words, all request methods -- ``POST``, ``GET``, ``HEAD``, etc. -- will be routed to the same |
