diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2008-09-09 01:54:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2008-09-09 01:54:20 +0000 |
| commit | 74f386dba274e319eb9e76cfb6f5d38e602104d9 (patch) | |
| tree | f39a1983daa4cf5650927daa729cf7f39176ae2b /docs/topics | |
| parent | 834a041e67b61f84b095c0796ed085f4c4785b0a (diff) | |
Fixed #8979 -- Made a bunch of typo/formatting fixes to the docs. Thanks, ramiro
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/forms/formsets.txt | 8 | ||||
| -rw-r--r-- | docs/topics/forms/index.txt | 14 | ||||
| -rw-r--r-- | docs/topics/http/sessions.txt | 2 | ||||
| -rw-r--r-- | docs/topics/i18n.txt | 2 | ||||
| -rw-r--r-- | docs/topics/templates.txt | 2 |
5 files changed, 21 insertions, 7 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index ca7aa2e14f..f3aa4a947e 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -306,7 +306,9 @@ management form inside the template. Lets look at a sample view:: formset = ArticleFormSet() return render_to_response('manage_articles.html', {'formset': formset}) -The ``manage_articles.html`` template might look like this:: +The ``manage_articles.html`` template might look like this: + +.. code-block:: html+django <form method="POST" action=""> {{ formset.management_form }} @@ -318,7 +320,9 @@ The ``manage_articles.html`` template might look like this:: </form> However the above can be slightly shortcutted and let the formset itself deal -with the management form:: +with the management form: + +.. code-block:: html+django <form method="POST" action=""> <table> diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index 48b4b2b28c..5cc76bdee8 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -10,6 +10,8 @@ Working with forms For a more detailed look at the forms API, see :ref:`ref-forms-api`. For documentation of the available field types, see :ref:`ref-forms-fields`. +.. highlightlang:: html+django + ``django.forms`` is Django's form-handling library. While it is possible to process form submissions just using Django's @@ -60,7 +62,9 @@ make use of a declarative style that you'll be familiar with if you've used Django's database models. For example, consider a form used to implement "contact me" functionality on a -personal Web site:: +personal Web site: + +.. code-block:: python from django import forms @@ -82,7 +86,9 @@ description. Using a form in a view ---------------------- -The standard pattern for processing a form in a view looks like this:: +The standard pattern for processing a form in a view looks like this: + +.. code-block:: python def contact(request): if request.method == 'POST': # If the form has been submitted... @@ -133,7 +139,9 @@ also be converted in to the relevant Python types for you. In the above example, ``cc_myself`` will be a boolean value. Likewise, fields such as ``IntegerField`` and ``FloatField`` convert values to a Python int and float respectively. -Extending the above example, here's how the form data could be processed:: +Extending the above example, here's how the form data could be processed: + +.. code-block:: python if form.is_valid(): subject = form.cleaned_data['subject'] diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 391e9b3e75..81d491700a 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -36,7 +36,7 @@ from your ``INSTALLED_APPS``. It'll save you a small bit of overhead. Configuring the session engine ============================== -.. versionadded:: 1.0. +.. versionadded:: 1.0 By default, Django stores sessions in your database (using the model ``django.contrib.sessions.models.Session``). Though this is convenient, in diff --git a/docs/topics/i18n.txt b/docs/topics/i18n.txt index 86268e9335..8ba2f9c89f 100644 --- a/docs/topics/i18n.txt +++ b/docs/topics/i18n.txt @@ -395,7 +395,7 @@ obtain) the language translations themselves. Here's how that works. application) and English strings (from Django itself). If you want to support a locale for your application that is not already part of Django, you'll need to make at least a minimal translation of the Django - core. See the relevant :ref:LocaleMiddleware note`<locale-middleware-notes>` + core. See the relevant :ref:`LocaleMiddleware note<locale-middleware-notes>` for more details. Message files diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt index 073964dfac..66361c8cef 100644 --- a/docs/topics/templates.txt +++ b/docs/topics/templates.txt @@ -38,6 +38,8 @@ or CheetahTemplate_, you should feel right at home with Django's templates. Templates ========= +.. highlightlang:: html+django + A template is simply a text file. It can generate any text-based format (HTML, XML, CSV, etc.). |
