summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminusf <minusf@gmail.com>2013-07-28 19:58:19 +0900
committerTim Graham <timograham@gmail.com>2013-07-29 07:06:34 -0400
commitb5ac25dc0c1d2d66b70451c551b271b920b85455 (patch)
tree3265c36618c1571f6760b0b3d1f42fc15ece74b1
parentf8e6434912784b8055ba33ca110047f5b5bb2856 (diff)
[1.5.x] Misc doc cleanups.
Backport of 70c080fcdb from master
-rw-r--r--docs/ref/forms/widgets.txt7
-rw-r--r--docs/topics/templates.txt4
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index ac16b3c02a..13d2fd5b99 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -52,8 +52,7 @@ widget on the field. In the following example, the
:attr:`~django.forms.extras.widgets.SelectDateWidget.years` attribute is set
for a :class:`~django.forms.extras.widgets.SelectDateWidget`::
- from django.forms.fields import DateField, ChoiceField, MultipleChoiceField
- from django.forms.widgets import RadioSelect, CheckboxSelectMultiple
+ from django import forms
from django.forms.extras.widgets import SelectDateWidget
BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
@@ -62,9 +61,9 @@ for a :class:`~django.forms.extras.widgets.SelectDateWidget`::
('black', 'Black'))
class SimpleForm(forms.Form):
- birth_year = DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES))
+ birth_year = forms.DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES))
favorite_colors = forms.MultipleChoiceField(required=False,
- widget=CheckboxSelectMultiple, choices=FAVORITE_COLORS_CHOICES)
+ widget=forms.CheckboxSelectMultiple, choices=FAVORITE_COLORS_CHOICES)
See the :ref:`built-in widgets` for more information about which widgets
are available and which arguments they accept.
diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt
index 58a3ee9870..c75b83f158 100644
--- a/docs/topics/templates.txt
+++ b/docs/topics/templates.txt
@@ -45,7 +45,9 @@ A template contains **variables**, which get replaced with values when the
template is evaluated, and **tags**, which control the logic of the template.
Below is a minimal template that illustrates a few basics. Each element will be
-explained later in this document.::
+explained later in this document.
+
+.. code-block:: html+django
{% extends "base_generic.html" %}