summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/class-based-views/base.txt34
-rw-r--r--docs/ref/class-based-views/flattened-index.txt78
-rw-r--r--docs/ref/class-based-views/generic-date-based.txt2
-rw-r--r--docs/ref/class-based-views/generic-display.txt40
-rw-r--r--docs/ref/class-based-views/generic-editing.txt10
-rw-r--r--docs/ref/class-based-views/mixins-date-based.txt9
-rw-r--r--docs/ref/class-based-views/mixins-editing.txt43
-rw-r--r--docs/ref/class-based-views/mixins-multiple-object.txt22
-rw-r--r--docs/ref/class-based-views/mixins-simple.txt12
-rw-r--r--docs/ref/class-based-views/mixins-single-object.txt41
-rw-r--r--docs/ref/clickjacking.txt8
-rw-r--r--docs/ref/contrib/admin/admindocs.txt2
-rw-r--r--docs/ref/contrib/admin/index.txt26
-rw-r--r--docs/ref/contrib/comments/custom.txt26
-rw-r--r--docs/ref/contrib/comments/example.txt4
-rw-r--r--docs/ref/contrib/comments/moderation.txt9
-rw-r--r--docs/ref/contrib/comments/signals.txt4
-rw-r--r--docs/ref/contrib/contenttypes.txt8
-rw-r--r--docs/ref/contrib/flatpages.txt4
-rw-r--r--docs/ref/contrib/formtools/form-preview.txt16
-rw-r--r--docs/ref/contrib/formtools/form-wizard.txt32
-rw-r--r--docs/ref/contrib/formtools/index.txt2
-rw-r--r--docs/ref/contrib/gis/db-api.txt17
-rw-r--r--docs/ref/contrib/gis/feeds.txt10
-rw-r--r--docs/ref/contrib/gis/geoquerysets.txt4
-rw-r--r--docs/ref/contrib/gis/geos.txt14
-rw-r--r--docs/ref/contrib/gis/install/index.txt2
-rw-r--r--docs/ref/contrib/gis/tutorial.txt14
-rw-r--r--docs/ref/contrib/sitemaps.txt29
-rw-r--r--docs/ref/contrib/staticfiles.txt10
-rw-r--r--docs/ref/contrib/syndication.txt2
-rw-r--r--docs/ref/databases.txt4
-rw-r--r--docs/ref/django-admin.txt2
-rw-r--r--docs/ref/exceptions.txt15
-rw-r--r--docs/ref/files/file.txt4
-rw-r--r--docs/ref/files/storage.txt2
-rw-r--r--docs/ref/forms/api.txt41
-rw-r--r--docs/ref/forms/widgets.txt12
-rw-r--r--docs/ref/middleware.txt4
-rw-r--r--docs/ref/models/fields.txt93
-rw-r--r--docs/ref/models/options.txt2
-rw-r--r--docs/ref/request-response.txt2
-rw-r--r--docs/ref/settings.txt2
-rw-r--r--docs/ref/signals.txt11
-rw-r--r--docs/ref/template-response.txt24
-rw-r--r--docs/ref/templates/api.txt22
-rw-r--r--docs/ref/templates/builtins.txt2
-rw-r--r--docs/ref/urls.txt2
-rw-r--r--docs/ref/utils.txt19
-rw-r--r--docs/ref/validators.txt2
50 files changed, 444 insertions, 355 deletions
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt
index cc9aa852f1..c070ea707a 100644
--- a/docs/ref/class-based-views/base.txt
+++ b/docs/ref/class-based-views/base.txt
@@ -49,9 +49,13 @@ View
**Attributes**
- .. attribute:: http_method_names = ['get', 'post', 'put', 'delete', 'head', 'options', 'trace']
+ .. attribute:: http_method_names
- The default list of HTTP method names that this view will accept.
+ The list of HTTP method names that this view will accept.
+
+ Default::
+
+ ['get', 'post', 'put', 'delete', 'head', 'options', 'trace']
**Methods**
@@ -68,12 +72,11 @@ View
The default implementation will inspect the HTTP method and attempt to
delegate to a method that matches the HTTP method; a ``GET`` will be
- delegated to :meth:`~View.get()`, a ``POST`` to :meth:`~View.post()`,
- and so on.
+ delegated to ``get()``, a ``POST`` to ``post()``, and so on.
- By default, a ``HEAD`` request will be delegated to :meth:`~View.get()`.
+ By default, a ``HEAD`` request will be delegated to ``get()``.
If you need to handle ``HEAD`` requests in a different way than ``GET``,
- you can override the :meth:`~View.head()` method. See
+ you can override the ``head()`` method. See
:ref:`supporting-other-http-methods` for an example.
The default implementation also sets ``request``, ``args`` and
@@ -111,9 +114,9 @@ TemplateView
**Method Flowchart**
- 1. :meth:`dispatch()`
- 2. :meth:`http_method_not_allowed()`
- 3. :meth:`get_context_data()`
+ 1. :meth:`~django.views.generic.base.View.dispatch()`
+ 2. :meth:`~django.views.generic.base.View.http_method_not_allowed()`
+ 3. :meth:`~django.views.generic.base.ContextMixin.get_context_data()`
**Example views.py**::
@@ -169,8 +172,8 @@ RedirectView
**Method Flowchart**
- 1. :meth:`dispatch()`
- 2. :meth:`http_method_not_allowed()`
+ 1. :meth:`~django.views.generic.base.View.dispatch()`
+ 2. :meth:`~django.views.generic.base.View.http_method_not_allowed()`
3. :meth:`get_redirect_url()`
**Example views.py**::
@@ -230,9 +233,8 @@ RedirectView
Constructs the target URL for redirection.
- The default implementation uses :attr:`~RedirectView.url` as a starting
+ The default implementation uses :attr:`url` as a starting
string, performs expansion of ``%`` parameters in that string, as well
- as the appending of query string if requested by
- :attr:`~RedirectView.query_string`. Subclasses may implement any
- behavior they wish, as long as the method returns a redirect-ready URL
- string.
+ as the appending of query string if requested by :attr:`query_string`.
+ Subclasses may implement any behavior they wish, as long as the method
+ returns a redirect-ready URL string.
diff --git a/docs/ref/class-based-views/flattened-index.txt b/docs/ref/class-based-views/flattened-index.txt
index aa2f51f156..2e75363c58 100644
--- a/docs/ref/class-based-views/flattened-index.txt
+++ b/docs/ref/class-based-views/flattened-index.txt
@@ -23,7 +23,7 @@ View
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
TemplateView
@@ -40,9 +40,9 @@ TemplateView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.base.TemplateView.get`
-* :meth:`~django.views.generic.base.TemplateView.get_context_data`
-* :meth:`~django.views.generic.base.View.head`
+* ``get()``
+* :meth:`~django.views.generic.base.ContextMixin.get_context_data`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -60,15 +60,15 @@ RedirectView
**Methods**
* :meth:`~django.views.generic.base.View.as_view`
-* :meth:`~django.views.generic.base.RedirectView.delete`
+* ``delete()``
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.base.RedirectView.get`
+* ``get()``
* :meth:`~django.views.generic.base.RedirectView.get_redirect_url`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
-* :meth:`~django.views.generic.base.RedirectView.options`
-* :meth:`~django.views.generic.base.RedirectView.post`
-* :meth:`~django.views.generic.base.RedirectView.put`
+* ``options()``
+* ``post()``
+* ``put()``
Detail Views
------------
@@ -95,10 +95,10 @@ DetailView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.detail.BaseDetailView.get`
+* ``get()``
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_context_data`
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -130,7 +130,7 @@ ListView
* :meth:`~django.views.generic.list.BaseListView.get`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -161,10 +161,10 @@ FormView
* :meth:`~django.views.generic.edit.FormMixin.get_context_data`
* :meth:`~django.views.generic.edit.FormMixin.get_form`
* :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
-* :meth:`~django.views.generic.edit.ProcessFormView.post`
-* :meth:`~django.views.generic.edit.ProcessFormView.put`
+* ``post()``
+* ``put()``
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
CreateView
@@ -199,10 +199,10 @@ CreateView
* :meth:`~django.views.generic.edit.FormMixin.get_form`
* :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.edit.ProcessFormView.post`
-* :meth:`~django.views.generic.edit.ProcessFormView.put`
+* ``put()``
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
UpdateView
@@ -237,10 +237,10 @@ UpdateView
* :meth:`~django.views.generic.edit.FormMixin.get_form`
* :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.edit.ProcessFormView.post`
-* :meth:`~django.views.generic.edit.ProcessFormView.put`
+* ``put()``
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
DeleteView
@@ -265,14 +265,14 @@ DeleteView
**Methods**
* :meth:`~django.views.generic.base.View.as_view`
-* :meth:`~django.views.generic.edit.DeletionMixin.delete`
+* ``delete()``
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.detail.BaseDetailView.get`
+* ``get()``
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_context_data`
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
-* :meth:`~django.views.generic.edit.DeletionMixin.post`
+* ``post()``
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
Date-based views
@@ -302,13 +302,13 @@ ArchiveIndexView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_queryset`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -324,7 +324,7 @@ YearArchiveView
* :attr:`~django.views.generic.list.MultipleObjectMixin.context_object_name` [:meth:`~django.views.generic.list.MultipleObjectMixin.get_context_object_name`]
* :attr:`~django.views.generic.dates.DateMixin.date_field` [:meth:`~django.views.generic.dates.DateMixin.get_date_field`]
* :attr:`~django.views.generic.base.View.http_method_names`
-* :attr:`~django.views.generic.dates.BaseYearArchiveView.make_object_list` [:meth:`~django.views.generic.dates.BaseYearArchiveView.get_make_object_list`]
+* :attr:`~django.views.generic.dates.YearArchiveView.make_object_list` [:meth:`~django.views.generic.dates.YearArchiveView.get_make_object_list`]
* :attr:`~django.views.generic.list.MultipleObjectMixin.model`
* :attr:`~django.views.generic.list.MultipleObjectMixin.paginate_by` [:meth:`~django.views.generic.list.MultipleObjectMixin.get_paginate_by`]
* :attr:`~django.views.generic.list.MultipleObjectMixin.paginate_orphans` [:meth:`~django.views.generic.list.MultipleObjectMixin.get_paginate_orphans`]
@@ -340,13 +340,13 @@ YearArchiveView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_queryset`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -379,7 +379,7 @@ MonthArchiveView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
@@ -387,7 +387,7 @@ MonthArchiveView
* :meth:`~django.views.generic.dates.MonthMixin.get_next_month`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
* :meth:`~django.views.generic.dates.MonthMixin.get_previous_month`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -420,13 +420,13 @@ WeekArchiveView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_queryset`
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -461,7 +461,7 @@ DayArchiveView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
@@ -471,7 +471,7 @@ DayArchiveView
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
* :meth:`~django.views.generic.dates.DayMixin.get_previous_day`
* :meth:`~django.views.generic.dates.MonthMixin.get_previous_month`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -506,7 +506,7 @@ TodayArchiveView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.dates.BaseDateListView.get`
+* ``get()``
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.BaseDateListView.get_date_list`
* :meth:`~django.views.generic.dates.BaseDateListView.get_dated_items`
@@ -516,7 +516,7 @@ TodayArchiveView
* :meth:`~django.views.generic.list.MultipleObjectMixin.get_paginator`
* :meth:`~django.views.generic.dates.DayMixin.get_previous_day`
* :meth:`~django.views.generic.dates.MonthMixin.get_previous_month`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.list.MultipleObjectMixin.paginate_queryset`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
@@ -551,13 +551,13 @@ DateDetailView
* :meth:`~django.views.generic.base.View.as_view`
* :meth:`~django.views.generic.base.View.dispatch`
-* :meth:`~django.views.generic.detail.BaseDetailView.get`
+* ``get()``
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_context_data`
* :meth:`~django.views.generic.dates.DayMixin.get_next_day`
* :meth:`~django.views.generic.dates.MonthMixin.get_next_month`
* :meth:`~django.views.generic.detail.SingleObjectMixin.get_object`
* :meth:`~django.views.generic.dates.DayMixin.get_previous_day`
* :meth:`~django.views.generic.dates.MonthMixin.get_previous_month`
-* :meth:`~django.views.generic.base.View.head`
+* ``head()``
* :meth:`~django.views.generic.base.View.http_method_not_allowed`
* :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`
diff --git a/docs/ref/class-based-views/generic-date-based.txt b/docs/ref/class-based-views/generic-date-based.txt
index 0ae0bcdf42..42dbab4dd8 100644
--- a/docs/ref/class-based-views/generic-date-based.txt
+++ b/docs/ref/class-based-views/generic-date-based.txt
@@ -580,7 +580,7 @@ DateDetailView
* :class:`django.views.generic.dates.MonthMixin`
* :class:`django.views.generic.dates.DayMixin`
* :class:`django.views.generic.dates.DateMixin`
- * :class:`django.views.generic.detail.BaseDetailView`
+ * ``django.views.generic.detail.BaseDetailView``
* :class:`django.views.generic.detail.SingleObjectMixin`
* :class:`django.views.generic.base.View`
diff --git a/docs/ref/class-based-views/generic-display.txt b/docs/ref/class-based-views/generic-display.txt
index 12603ff0df..b827c0005c 100644
--- a/docs/ref/class-based-views/generic-display.txt
+++ b/docs/ref/class-based-views/generic-display.txt
@@ -19,22 +19,22 @@ DetailView
* :class:`django.views.generic.detail.SingleObjectTemplateResponseMixin`
* :class:`django.views.generic.base.TemplateResponseMixin`
- * :class:`django.views.generic.detail.BaseDetailView`
+ * ``django.views.generic.detail.BaseDetailView``
* :class:`django.views.generic.detail.SingleObjectMixin`
* :class:`django.views.generic.base.View`
**Method Flowchart**
- 1. :meth:`dispatch()`
- 2. :meth:`http_method_not_allowed()`
- 3. :meth:`get_template_names()`
- 4. :meth:`get_slug_field()`
- 5. :meth:`get_queryset()`
- 6. :meth:`get_object()`
- 7. :meth:`get_context_object_name()`
- 8. :meth:`get_context_data()`
- 9. :meth:`get()`
- 10. :meth:`render_to_response()`
+ 1. :meth:`~django.views.generic.base.View.dispatch()`
+ 2. :meth:`~django.views.generic.base.View.http_method_not_allowed()`
+ 3. :meth:`~django.views.generic.base.TemplateResponseMixin.get_template_names()`
+ 4. :meth:`~django.views.generic.detail.SingleObjectMixin.get_slug_field()`
+ 5. :meth:`~django.views.generic.detail.SingleObjectMixin.get_queryset()`
+ 6. :meth:`~django.views.generic.detail.SingleObjectMixin.get_object()`
+ 7. :meth:`~django.views.generic.detail.SingleObjectMixin.get_context_object_name()`
+ 8. :meth:`~django.views.generic.detail.SingleObjectMixin.get_context_data()`
+ 9. ``get()``
+ 10. :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response()`
**Example views.py**::
@@ -86,14 +86,14 @@ ListView
**Method Flowchart**
- 1. :meth:`dispatch()`
- 2. :meth:`http_method_not_allowed()`
- 3. :meth:`get_template_names()`
- 4. :meth:`get_queryset()`
- 5. :meth:`get_objects()`
- 6. :meth:`get_context_data()`
- 7. :meth:`get()`
- 8. :meth:`render_to_response()`
+ 1. :meth:`~django.views.generic.base.View.dispatch()`
+ 2. :meth:`~django.views.generic.base.View.http_method_not_allowed()`
+ 3. :meth:`~django.views.generic.base.TemplateResponseMixin.get_template_names()`
+ 4. :meth:`~django.views.generic.list.MultipleObjectMixin.get_queryset()`
+ 5. :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_object_name()`
+ 6. :meth:`~django.views.generic.list.MultipleObjectMixin.get_context_data()`
+ 7. ``get()``
+ 8. :meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response()`
**Example views.py**::
@@ -140,7 +140,7 @@ ListView
.. method:: get(request, *args, **kwargs)
- Adds :attr:`object_list` to the context. If
+ Adds ``object_list`` to the context. If
:attr:`~django.views.generic.list.MultipleObjectMixin.allow_empty`
is True then display an empty list. If
:attr:`~django.views.generic.list.MultipleObjectMixin.allow_empty` is
diff --git a/docs/ref/class-based-views/generic-editing.txt b/docs/ref/class-based-views/generic-editing.txt
index 789dc2f84f..f3679287ad 100644
--- a/docs/ref/class-based-views/generic-editing.txt
+++ b/docs/ref/class-based-views/generic-editing.txt
@@ -38,7 +38,7 @@ FormView
* :class:`django.views.generic.edit.FormView`
* :class:`django.views.generic.base.TemplateResponseMixin`
- * :class:`django.views.generic.edit.BaseFormView`
+ * ``django.views.generic.edit.BaseFormView``
* :class:`django.views.generic.edit.FormMixin`
* :class:`django.views.generic.edit.ProcessFormView`
* :class:`django.views.generic.base.View`
@@ -86,7 +86,7 @@ CreateView
* :class:`django.views.generic.edit.CreateView`
* :class:`django.views.generic.detail.SingleObjectTemplateResponseMixin`
* :class:`django.views.generic.base.TemplateResponseMixin`
- * :class:`django.views.generic.edit.BaseCreateView`
+ * ``django.views.generic.edit.BaseCreateView``
* :class:`django.views.generic.edit.ModelFormMixin`
* :class:`django.views.generic.edit.FormMixin`
* :class:`django.views.generic.detail.SingleObjectMixin`
@@ -128,7 +128,7 @@ UpdateView
* :class:`django.views.generic.edit.UpdateView`
* :class:`django.views.generic.detail.SingleObjectTemplateResponseMixin`
* :class:`django.views.generic.base.TemplateResponseMixin`
- * :class:`django.views.generic.edit.BaseUpdateView`
+ * ``django.views.generic.edit.BaseUpdateView``
* :class:`django.views.generic.edit.ModelFormMixin`
* :class:`django.views.generic.edit.FormMixin`
* :class:`django.views.generic.detail.SingleObjectMixin`
@@ -170,9 +170,9 @@ DeleteView
* :class:`django.views.generic.edit.DeleteView`
* :class:`django.views.generic.detail.SingleObjectTemplateResponseMixin`
* :class:`django.views.generic.base.TemplateResponseMixin`
- * :class:`django.views.generic.edit.BaseDeleteView`
+ * ``django.views.generic.edit.BaseDeleteView``
* :class:`django.views.generic.edit.DeletionMixin`
- * :class:`django.views.generic.detail.BaseDetailView`
+ * ``django.views.generic.detail.BaseDetailView``
* :class:`django.views.generic.detail.SingleObjectMixin`
* :class:`django.views.generic.base.View`
diff --git a/docs/ref/class-based-views/mixins-date-based.txt b/docs/ref/class-based-views/mixins-date-based.txt
index 561e525e70..7ff201e5a2 100644
--- a/docs/ref/class-based-views/mixins-date-based.txt
+++ b/docs/ref/class-based-views/mixins-date-based.txt
@@ -100,7 +100,7 @@ MonthMixin
:attr:`~BaseDateListView.allow_empty` and
:attr:`~DateMixin.allow_future`.
- .. method:: get_prev_month(date)
+ .. method:: get_previous_month(date)
Returns a date object containing the first day of the month before the
date provided. This function can also return ``None`` or raise an
@@ -152,7 +152,7 @@ DayMixin
:attr:`~BaseDateListView.allow_empty` and
:attr:`~DateMixin.allow_future`.
- .. method:: get_prev_day(date)
+ .. method:: get_previous_day(date)
Returns a date object containing the previous valid day. This function
can also return ``None`` or raise an :class:`~django.http.Http404`
@@ -287,8 +287,9 @@ BaseDateListView
available. If this is ``True`` and no objects are available, the view
will display an empty page instead of raising a 404.
- This is identical to :attr:`MultipleObjectMixin.allow_empty`, except
- for the default value, which is ``False``.
+ This is identical to
+ :attr:`django.views.generic.list.MultipleObjectMixin.allow_empty`,
+ except for the default value, which is ``False``.
.. attribute:: date_list_period
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt
index b8b59b827f..bce3c84cb1 100644
--- a/docs/ref/class-based-views/mixins-editing.txt
+++ b/docs/ref/class-based-views/mixins-editing.txt
@@ -83,9 +83,8 @@ FormMixin
.. note::
- Views mixing :class:`FormMixin` must provide an implementation of
- :meth:`~django.views.generic.FormMixin.form_valid` and
- :meth:`~django.views.generic.FormMixin.form_invalid`.
+ Views mixing ``FormMixin`` must provide an implementation of
+ :meth:`form_valid` and :meth:`form_invalid`.
ModelFormMixin
@@ -93,15 +92,16 @@ ModelFormMixin
.. class:: django.views.generic.edit.ModelFormMixin
- A form mixin that works on ModelForms, rather than a standalone form.
+ A form mixin that works on ``ModelForms``, rather than a standalone form.
Since this is a subclass of
:class:`~django.views.generic.detail.SingleObjectMixin`, instances of this
- mixin have access to the :attr:`~SingleObjectMixin.model` and
- :attr:`~SingleObjectMixin.queryset` attributes, describing the type of
- object that the ModelForm is manipulating. The view also provides
- ``self.object``, the instance being manipulated. If the instance is being
- created, ``self.object`` will be ``None``.
+ mixin have access to the
+ :attr:`~django.views.generic.detail.SingleObjectMixin.model` and
+ :attr:`~django.views.generic.detail.SingleObjectMixin.queryset` attributes,
+ describing the type of object that the ``ModelForm`` is manipulating. The
+ view also provides ``self.object``, the instance being manipulated. If the
+ instance is being created, ``self.object`` will be ``None``.
**Mixins**
@@ -110,6 +110,12 @@ ModelFormMixin
**Methods and Attributes**
+ .. attribute:: model
+
+ A model class. Can be explicitly provided, otherwise will be determined
+ by examining ``self.object`` or
+ :attr:`~django.views.generic.detail.SingleObjectMixin.queryset`.
+
.. attribute:: success_url
The URL to redirect to when the form is successfully processed.
@@ -122,22 +128,25 @@ ModelFormMixin
.. method:: get_form_class()
Retrieve the form class to instantiate. If
- :attr:`FormMixin.form_class` is provided, that class will be used.
- Otherwise, a ModelForm will be instantiated using the model associated
- with the :attr:`~SingleObjectMixin.queryset`, or with the
- :attr:`~SingleObjectMixin.model`, depending on which attribute is
- provided.
+ :attr:`~django.views.generic.edit.FormMixin.form_class` is provided,
+ that class will be used. Otherwise, a ``ModelForm`` will be
+ instantiated using the model associated with the
+ :attr:`~django.views.generic.detail.SingleObjectMixin.queryset`, or
+ with the :attr:`~django.views.generic.detail.SingleObjectMixin.model`,
+ depending on which attribute is provided.
.. method:: get_form_kwargs()
Add the current instance (``self.object``) to the standard
- :meth:`FormMixin.get_form_kwargs`.
+ :meth:`~django.views.generic.edit.FormMixin.get_form_kwargs`.
.. method:: get_success_url()
Determine the URL to redirect to when the form is successfully
- validated. Returns :attr:`ModelFormMixin.success_url` if it is provided;
- otherwise, attempts to use the ``get_absolute_url()`` of the object.
+ validated. Returns
+ :attr:`django.views.generic.edit.ModelFormMixin.success_url` if it is
+ provided; otherwise, attempts to use the ``get_absolute_url()`` of the
+ object.
.. method:: form_valid(form)
diff --git a/docs/ref/class-based-views/mixins-multiple-object.txt b/docs/ref/class-based-views/mixins-multiple-object.txt
index c85c962bce..b28bd11a71 100644
--- a/docs/ref/class-based-views/mixins-multiple-object.txt
+++ b/docs/ref/class-based-views/mixins-multiple-object.txt
@@ -61,14 +61,13 @@ MultipleObjectMixin
.. attribute:: queryset
A ``QuerySet`` that represents the objects. If provided, the value of
- :attr:`MultipleObjectMixin.queryset` supersedes the value provided for
- :attr:`MultipleObjectMixin.model`.
+ ``queryset`` supersedes the value provided for :attr:`model`.
.. attribute:: paginate_by
An integer specifying how many objects should be displayed per page. If
this is given, the view will paginate objects with
- :attr:`MultipleObjectMixin.paginate_by` objects per page. The view will
+ ``paginate_by`` objects per page. The view will
expect either a ``page`` query string parameter (via ``request.GET``)
or a ``page`` variable specified in the URLconf.
@@ -77,10 +76,9 @@ MultipleObjectMixin
.. versionadded:: 1.6
An integer specifying the number of "overflow" objects the last page
- can contain. This extends the :attr:`MultipleObjectMixin.paginate_by`
- limit on the last page by up to
- :attr:`MultipleObjectMixin.paginate_orphans`, in order to keep the last
- page from having a very small number of objects.
+ can contain. This extends the :attr:`paginate_by` limit on the last
+ page by up to ``paginate_orphans``, in order to keep the last page from
+ having a very small number of objects.
.. attribute:: page_kwarg
@@ -97,7 +95,7 @@ MultipleObjectMixin
:class:`django.core.paginator.Paginator` is used. If the custom paginator
class doesn't have the same constructor interface as
:class:`django.core.paginator.Paginator`, you will also need to
- provide an implementation for :meth:`MultipleObjectMixin.get_paginator`.
+ provide an implementation for :meth:`get_paginator`.
.. attribute:: context_object_name
@@ -122,20 +120,20 @@ MultipleObjectMixin
Returns the number of items to paginate by, or ``None`` for no
pagination. By default this simply returns the value of
- :attr:`MultipleObjectMixin.paginate_by`.
+ :attr:`paginate_by`.
.. method:: get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True)
Returns an instance of the paginator to use for this view. By default,
instantiates an instance of :attr:`paginator_class`.
- .. method:: get_paginate_by()
+ .. method:: get_paginate_orphans()
.. versionadded:: 1.6
An integer specifying the number of "overflow" objects the last page
can contain. By default this simply returns the value of
- :attr:`MultipleObjectMixin.paginate_orphans`.
+ :attr:`paginate_orphans`.
.. method:: get_allow_empty()
@@ -149,7 +147,7 @@ MultipleObjectMixin
Return the context variable name that will be used to contain
the list of data that this view is manipulating. If
``object_list`` is a queryset of Django objects and
- :attr:`~MultipleObjectMixin.context_object_name` is not set,
+ :attr:`context_object_name` is not set,
the context name will be the ``object_name`` of the model that
the queryset is composed from, with postfix ``'_list'``
appended. For example, the model ``Article`` would have a
diff --git a/docs/ref/class-based-views/mixins-simple.txt b/docs/ref/class-based-views/mixins-simple.txt
index d2f0df241e..e2e6084e8e 100644
--- a/docs/ref/class-based-views/mixins-simple.txt
+++ b/docs/ref/class-based-views/mixins-simple.txt
@@ -48,7 +48,7 @@ TemplateResponseMixin
.. attribute:: template_name
The full name of a template to use as defined by a string. Not defining
- a template_name will raise a
+ a ``template_name`` will raise a
:class:`django.core.exceptions.ImproperlyConfigured` exception.
.. attribute:: response_class
@@ -73,15 +73,13 @@ TemplateResponseMixin
If any keyword arguments are provided, they will be passed to the
constructor of the response class.
- Calls :meth:`~TemplateResponseMixin.get_template_names()` to obtain the
- list of template names that will be searched looking for an existent
- template.
+ Calls :meth:`get_template_names()` to obtain the list of template names
+ that will be searched looking for an existent template.
.. method:: get_template_names()
Returns a list of template names to search for when rendering the
template.
- If :attr:`TemplateResponseMixin.template_name` is specified, the
- default implementation will return a list containing
- :attr:`TemplateResponseMixin.template_name` (if it is specified).
+ If :attr:`template_name` is specified, the default implementation will
+ return a list containing :attr:`template_name` (if it is specified).
diff --git a/docs/ref/class-based-views/mixins-single-object.txt b/docs/ref/class-based-views/mixins-single-object.txt
index e84ba6b8dd..299ac56ac6 100644
--- a/docs/ref/class-based-views/mixins-single-object.txt
+++ b/docs/ref/class-based-views/mixins-single-object.txt
@@ -21,8 +21,7 @@ SingleObjectMixin
.. attribute:: queryset
A ``QuerySet`` that represents the objects. If provided, the value of
- :attr:`SingleObjectMixin.queryset` supersedes the value provided for
- :attr:`SingleObjectMixin.model`.
+ ``queryset`` supersedes the value provided for :attr:`model`.
.. attribute:: slug_field
@@ -47,38 +46,38 @@ SingleObjectMixin
Returns the single object that this view will display. If
``queryset`` is provided, that queryset will be used as the
- source of objects; otherwise,
- :meth:`~SingleObjectMixin.get_queryset` will be used.
- ``get_object()`` looks for a
- :attr:`SingleObjectMixin.pk_url_kwarg` argument in the arguments
- to the view; if this argument is found, this method performs a
- primary-key based lookup using that value. If this argument is not
- found, it looks for a :attr:`SingleObjectMixin.slug_url_kwarg`
- argument, and performs a slug lookup using the
- :attr:`SingleObjectMixin.slug_field`.
+ source of objects; otherwise, :meth:`get_queryset` will be used.
+ ``get_object()`` looks for a :attr:`pk_url_kwarg` argument in the
+ arguments to the view; if this argument is found, this method performs
+ a primary-key based lookup using that value. If this argument is not
+ found, it looks for a :attr:`slug_url_kwarg` argument, and performs a
+ slug lookup using the :attr:`slug_field`.
.. method:: get_queryset()
Returns the queryset that will be used to retrieve the object that
- this view will display. By default,
- :meth:`~SingleObjectMixin.get_queryset` returns the value of the
- :attr:`~SingleObjectMixin.queryset` attribute if it is set, otherwise
- it constructs a :class:`QuerySet` by calling the `all()` method on the
- :attr:`~SingleObjectMixin.model` attribute's default manager.
+ this view will display. By default, :meth:`get_queryset` returns the
+ value of the :attr:`queryset` attribute if it is set, otherwise
+ it constructs a :class:`~django.db.models.query.QuerySet` by calling
+ the `all()` method on the :attr:`model` attribute's default manager.
.. method:: get_context_object_name(obj)
Return the context variable name that will be used to contain the
- data that this view is manipulating. If
- :attr:`~SingleObjectMixin.context_object_name` is not set, the context
- name will be constructed from the ``object_name`` of the model that
- the queryset is composed from. For example, the model ``Article``
- would have context object named ``'article'``.
+ data that this view is manipulating. If :attr:`context_object_name` is
+ not set, the context name will be constructed from the ``object_name``
+ of the model that the queryset is composed from. For example, the model
+ ``Article`` would have context object named ``'article'``.
.. method:: get_context_data(**kwargs)
Returns context data for displaying the list of objects.
+ .. method:: get_slug_field()
+
+ Returns the name of a slug field to be used to look up by slug. By
+ default this simply returns the value of :attr:`slug_field`.
+
**Context**
* ``object``: The object that this view is displaying. If
diff --git a/docs/ref/clickjacking.txt b/docs/ref/clickjacking.txt
index 15e85b43b7..e3d1bfc87b 100644
--- a/docs/ref/clickjacking.txt
+++ b/docs/ref/clickjacking.txt
@@ -111,10 +111,10 @@ Browsers that support X-Frame-Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Internet Explorer 8+
-* Firefox 3.6.9+
-* Opera 10.5+
-* Safari 4+
-* Chrome 4.1+
+* Firefox 3.6.9+
+* Opera 10.5+
+* Safari 4+
+* Chrome 4.1+
See also
~~~~~~~~
diff --git a/docs/ref/contrib/admin/admindocs.txt b/docs/ref/contrib/admin/admindocs.txt
index 4a50856f3d..b3e26eca48 100644
--- a/docs/ref/contrib/admin/admindocs.txt
+++ b/docs/ref/contrib/admin/admindocs.txt
@@ -24,7 +24,7 @@ the following:
* Add :mod:`django.contrib.admindocs` to your :setting:`INSTALLED_APPS`.
* Add ``(r'^admin/doc/', include('django.contrib.admindocs.urls'))`` to
- your :data:`urlpatterns`. Make sure it's included *before* the
+ your ``urlpatterns``. Make sure it's included *before* the
``r'^admin/'`` entry, so that requests to ``/admin/doc/`` don't get
handled by the latter entry.
* Install the docutils Python module (http://docutils.sf.net/).
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index ec63cb2dcc..04a7824417 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -170,7 +170,7 @@ subclass::
``fields`` option (for more complex layout needs see the
:attr:`~ModelAdmin.fieldsets` option described in the next section). For
example, you could define a simpler version of the admin form for the
- ``django.contrib.flatpages.FlatPage`` model as follows::
+ :class:`django.contrib.flatpages.models.FlatPage` model as follows::
class FlatPageAdmin(admin.ModelAdmin):
fields = ('url', 'title', 'content')
@@ -212,8 +212,8 @@ subclass::
a dictionary of information about the fieldset, including a list of fields
to be displayed in it.
- A full example, taken from the :class:`django.contrib.flatpages.FlatPage`
- model::
+ A full example, taken from the
+ :class:`django.contrib.flatpages.models.FlatPage` model::
class FlatPageAdmin(admin.ModelAdmin):
fieldsets = (
@@ -357,7 +357,7 @@ subclass::
Note that the key in the dictionary is the actual field class, *not* a
string. The value is another dictionary; these arguments will be passed to
- :meth:`~django.forms.Field.__init__`. See :doc:`/ref/forms/api` for
+ the form field's ``__init__()`` method. See :doc:`/ref/forms/api` for
details.
.. warning::
@@ -584,7 +584,7 @@ subclass::
class PersonAdmin(UserAdmin):
list_filter = ('company__name',)
- * a class inheriting from :mod:`django.contrib.admin.SimpleListFilter`,
+ * a class inheriting from ``django.contrib.admin.SimpleListFilter``,
which you need to provide the ``title`` and ``parameter_name``
attributes to and override the ``lookups`` and ``queryset`` methods,
e.g.::
@@ -671,7 +671,7 @@ subclass::
* a tuple, where the first element is a field name and the second
element is a class inheriting from
- :mod:`django.contrib.admin.FieldListFilter`, for example::
+ ``django.contrib.admin.FieldListFilter``, for example::
from django.contrib.admin import BooleanFieldListFilter
@@ -943,10 +943,9 @@ templates used by the :class:`ModelAdmin` views:
.. attribute:: ModelAdmin.delete_selected_confirmation_template
- Path to a custom template, used by the :meth:`delete_selected`
- action method for displaying a confirmation page when deleting one
- or more objects. See the :doc:`actions
- documentation</ref/contrib/admin/actions>`.
+ Path to a custom template, used by the ``delete_selected`` action method
+ for displaying a confirmation page when deleting one or more objects. See
+ the :doc:`actions documentation</ref/contrib/admin/actions>`.
.. attribute:: ModelAdmin.object_history_template
@@ -1108,9 +1107,8 @@ templates used by the :class:`ModelAdmin` views:
Since this is usually not what you want, Django provides a convenience
wrapper to check permissions and mark the view as non-cacheable. This
- wrapper is :meth:`AdminSite.admin_view` (i.e.
- ``self.admin_site.admin_view`` inside a ``ModelAdmin`` instance); use it
- like so::
+ wrapper is ``AdminSite.admin_view()`` (i.e. ``self.admin_site.admin_view``
+ inside a ``ModelAdmin`` instance); use it like so::
class MyModelAdmin(admin.ModelAdmin):
def get_urls(self):
@@ -1130,7 +1128,7 @@ templates used by the :class:`ModelAdmin` views:
If the page is cacheable, but you still want the permission check to be
performed, you can pass a ``cacheable=True`` argument to
- :meth:`AdminSite.admin_view`::
+ ``AdminSite.admin_view()``::
(r'^my_view/$', self.admin_site.admin_view(self.my_view, cacheable=True))
diff --git a/docs/ref/contrib/comments/custom.txt b/docs/ref/contrib/comments/custom.txt
index 0ef37a9a0b..b4ab65bc2d 100644
--- a/docs/ref/contrib/comments/custom.txt
+++ b/docs/ref/contrib/comments/custom.txt
@@ -66,15 +66,17 @@ In the ``models.py`` we'll define a ``CommentWithTitle`` model::
class CommentWithTitle(Comment):
title = models.CharField(max_length=300)
-Most custom comment models will subclass the :class:`Comment` model. However,
+Most custom comment models will subclass the
+:class:`~django.contrib.comments.models.Comment` model. However,
if you want to substantially remove or change the fields available in the
-:class:`Comment` model, but don't want to rewrite the templates, you could
-try subclassing from :class:`BaseCommentAbstractModel`.
+:class:`~django.contrib.comments.models.Comment` model, but don't want to
+rewrite the templates, you could try subclassing from
+``BaseCommentAbstractModel``.
Next, we'll define a custom comment form in ``forms.py``. This is a little more
tricky: we have to both create a form and override
-:meth:`CommentForm.get_comment_model` and
-:meth:`CommentForm.get_comment_create_data` to return deal with our custom title
+``CommentForm.get_comment_model()`` and
+``CommentForm.get_comment_create_data()`` to return deal with our custom title
field::
from django import forms
@@ -139,7 +141,7 @@ however.
Return the :class:`~django.db.models.Model` class to use for comments. This
model should inherit from
- :class:`django.contrib.comments.models.BaseCommentAbstractModel`, which
+ ``django.contrib.comments.models.BaseCommentAbstractModel``, which
defines necessary core fields.
The default implementation returns
@@ -170,33 +172,33 @@ however.
attribute when rendering your comment form.
The default implementation returns a reverse-resolved URL pointing
- to the :func:`post_comment` view.
+ to the ``post_comment()`` view.
.. note::
If you provide a custom comment model and/or form, but you
- want to use the default :func:`post_comment` view, you will
+ want to use the default ``post_comment()`` view, you will
need to be aware that it requires the model and form to have
certain additional attributes and methods: see the
- :func:`post_comment` view documentation for details.
+ ``django.contrib.comments.views.post_comment()`` view for details.
.. function:: get_flag_url()
Return the URL for the "flag this comment" view.
The default implementation returns a reverse-resolved URL pointing
- to the :func:`django.contrib.comments.views.moderation.flag` view.
+ to the ``django.contrib.comments.views.moderation.flag()`` view.
.. function:: get_delete_url()
Return the URL for the "delete this comment" view.
The default implementation returns a reverse-resolved URL pointing
- to the :func:`django.contrib.comments.views.moderation.delete` view.
+ to the ``django.contrib.comments.views.moderation.delete()`` view.
.. function:: get_approve_url()
Return the URL for the "approve this comment from moderation" view.
The default implementation returns a reverse-resolved URL pointing
- to the :func:`django.contrib.comments.views.moderation.approve` view.
+ to the ``django.contrib.comments.views.moderation.approve()`` view.
diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt
index 2bff778c2f..4e18e37de0 100644
--- a/docs/ref/contrib/comments/example.txt
+++ b/docs/ref/contrib/comments/example.txt
@@ -136,7 +136,7 @@ Feeds
=====
Suppose you want to export a :doc:`feed </ref/contrib/syndication>` of the
-latest comments, you can use the built-in :class:`LatestCommentFeed`. Just
+latest comments, you can use the built-in ``LatestCommentFeed``. Just
enable it in your project's ``urls.py``:
.. code-block:: python
@@ -166,7 +166,7 @@ features (all of which or only certain can be enabled):
* Close comments after a particular (user-defined) number of days.
* Email new comments to the site-staff.
-To enable comment moderation, we subclass the :class:`CommentModerator` and
+To enable comment moderation, we subclass the ``CommentModerator`` and
register it with the moderation features we want. Let's suppose we want to
close comments after 7 days of posting and also send out an email to the
site staff. In ``blog/models.py``, we register a comment moderator in the
diff --git a/docs/ref/contrib/comments/moderation.txt b/docs/ref/contrib/comments/moderation.txt
index c042971d39..a7138dda53 100644
--- a/docs/ref/contrib/comments/moderation.txt
+++ b/docs/ref/contrib/comments/moderation.txt
@@ -185,15 +185,14 @@ via two methods:
be moderated using the options defined in the
``CommentModerator`` subclass. If any of the models are
already registered for moderation, the exception
- :exc:`AlreadyModerated` will be raised.
+ ``AlreadyModerated`` will be raised.
.. function:: moderator.unregister(model_or_iterable)
Takes one argument: a model class or list of model classes,
and removes the model or models from the set of models which
are being moderated. If any of the models are not currently
- being moderated, the exception
- :exc:`NotModerated` will be raised.
+ being moderated, the exception ``NotModerated`` will be raised.
Customizing the moderation system
@@ -207,8 +206,8 @@ models with an instance of the subclass.
.. class:: Moderator
- In addition to the :meth:`Moderator.register` and
- :meth:`Moderator.unregister` methods detailed above, the following methods
+ In addition to the :func:`moderator.register` and
+ :func:`moderator.unregister` methods detailed above, the following methods
on :class:`Moderator` can be overridden to achieve customized behavior:
.. method:: connect
diff --git a/docs/ref/contrib/comments/signals.txt b/docs/ref/contrib/comments/signals.txt
index 8274539ed7..ea901b6a95 100644
--- a/docs/ref/contrib/comments/signals.txt
+++ b/docs/ref/contrib/comments/signals.txt
@@ -81,8 +81,8 @@ Arguments sent with this signal:
:meth:`~django.db.models.Model.save` again.
``flag``
- The :class:`~django.contrib.comments.models.CommentFlag` that's been
- attached to the comment.
+ The ``django.contrib.comments.models.CommentFlag`` that's been attached to
+ the comment.
``created``
``True`` if this is a new flag; ``False`` if it's a duplicate flag.
diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt
index 8f329aa388..e9cd5e7bc0 100644
--- a/docs/ref/contrib/contenttypes.txt
+++ b/docs/ref/contrib/contenttypes.txt
@@ -453,7 +453,7 @@ Generic relations in forms and admin
------------------------------------
The :mod:`django.contrib.contenttypes.generic` module provides
-:class:`~django.contrib.contenttypes.generic.BaseGenericInlineFormSet`,
+``BaseGenericInlineFormSet``,
:class:`~django.contrib.contenttypes.generic.GenericTabularInline`
and :class:`~django.contrib.contenttypes.generic.GenericStackedInline`
(the last two are subclasses of
@@ -480,3 +480,9 @@ information.
The name of the integer field that represents the ID of the related
object. Defaults to ``object_id``.
+
+.. class:: GenericTabularInline
+.. class:: GenericStackedInline
+
+ Subclasses of :class:`GenericInlineModelAdmin` with stacked and tabular
+ layouts, respectively.
diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt
index c360809dac..292b304acb 100644
--- a/docs/ref/contrib/flatpages.txt
+++ b/docs/ref/contrib/flatpages.txt
@@ -186,7 +186,7 @@ Via the Python API
If you add or modify flatpages via your own code, you will likely want to
check for duplicate flatpage URLs within the same site. The flatpage form
used in the admin performs this validation check, and can be imported from
- :class:`django.contrib.flatpages.forms.FlatPageForm` and used in your own
+ ``django.contrib.flatpages.forms.FlatPageForm`` and used in your own
views.
Flatpage templates
@@ -256,7 +256,7 @@ Displaying ``registration_required`` flatpages
By default, the :ttag:`get_flatpages` templatetag will only show
flatpages that are marked ``registration_required = False``. If you
want to display registration-protected flatpages, you need to specify
-an authenticated user using a``for`` clause.
+an authenticated user using a ``for`` clause.
For example:
diff --git a/docs/ref/contrib/formtools/form-preview.txt b/docs/ref/contrib/formtools/form-preview.txt
index 784213ecba..011e72c2e0 100644
--- a/docs/ref/contrib/formtools/form-preview.txt
+++ b/docs/ref/contrib/formtools/form-preview.txt
@@ -25,9 +25,8 @@ application takes care of the following workflow:
a. If it's valid, displays a preview page.
b. If it's not valid, redisplays the form with error messages.
3. When the "confirmation" form is submitted from the preview page, calls
- a hook that you define -- a
- :meth:`~django.contrib.formtools.preview.FormPreview.done()` method that gets
- passed the valid data.
+ a hook that you define -- a ``done()`` method that gets passed the valid
+ data.
The framework enforces the required preview by passing a shared-secret hash to
the preview page via hidden form fields. If somebody tweaks the form parameters
@@ -51,8 +50,7 @@ How to use ``FormPreview``
directory to your :setting:`TEMPLATE_DIRS` setting.
2. Create a :class:`~django.contrib.formtools.preview.FormPreview` subclass that
- overrides the :meth:`~django.contrib.formtools.preview.FormPreview.done()`
- method::
+ overrides the ``done()`` method::
from django.contrib.formtools.preview import FormPreview
from myapp.models import SomeModel
@@ -92,13 +90,15 @@ How to use ``FormPreview``
A :class:`~django.contrib.formtools.preview.FormPreview` class is a simple Python class
that represents the preview workflow.
:class:`~django.contrib.formtools.preview.FormPreview` classes must subclass
-``django.contrib.formtools.preview.FormPreview`` and override the
-:meth:`~django.contrib.formtools.preview.FormPreview.done()` method. They can live
-anywhere in your codebase.
+``django.contrib.formtools.preview.FormPreview`` and override the ``done()``
+method. They can live anywhere in your codebase.
``FormPreview`` templates
=========================
+.. attribute:: FormPreview.form_template
+.. attribute:: FormPreview.preview_template
+
By default, the form is rendered via the template :file:`formtools/form.html`,
and the preview page is rendered via the template :file:`formtools/preview.html`.
These values can be overridden for a particular form preview by setting
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
index 3edc019d05..9ea65d7e5f 100644
--- a/docs/ref/contrib/formtools/form-wizard.txt
+++ b/docs/ref/contrib/formtools/form-wizard.txt
@@ -54,7 +54,8 @@ you just have to do these things:
4. Add ``django.contrib.formtools`` to your
:setting:`INSTALLED_APPS` list in your settings file.
-5. Point your URLconf at your :class:`WizardView` :meth:`~WizardView.as_view` method.
+5. Point your URLconf at your :class:`WizardView` :meth:`~WizardView.as_view`
+ method.
Defining ``Form`` classes
-------------------------
@@ -89,6 +90,9 @@ the message itself. Here's what the :file:`forms.py` might look like::
Creating a ``WizardView`` subclass
----------------------------------
+.. class:: SessionWizardView
+.. class:: CookieWizardView
+
The next step is to create a
:class:`django.contrib.formtools.wizard.views.WizardView` subclass. You can
also use the :class:`SessionWizardView` or :class:`CookieWizardView` classes
@@ -225,9 +229,11 @@ Here's a full example template:
Hooking the wizard into a URLconf
---------------------------------
+.. method:: WizardView.as_view
+
Finally, we need to specify which forms to use in the wizard, and then
deploy the new :class:`WizardView` object at a URL in the ``urls.py``. The
-wizard's :meth:`as_view` method takes a list of your
+wizard's ``as_view()`` method takes a list of your
:class:`~django.forms.Form` classes as an argument during instantiation::
from django.conf.urls import patterns
@@ -346,9 +352,9 @@ Advanced ``WizardView`` methods
used as the form for step ``step``.
Returns an :class:`~django.db.models.Model` object which will be passed as
- the :attr:`~django.forms.ModelForm.instance` argument when instantiating the
- ModelForm for step ``step``. If no instance object was provided while
- initializing the form wizard, ``None`` will be returned.
+ the ``instance`` argument when instantiating the ``ModelForm`` for step
+ ``step``. If no instance object was provided while initializing the form
+ wizard, ``None`` will be returned.
The default implementation::
@@ -514,10 +520,10 @@ Providing initial data for the forms
.. attribute:: WizardView.initial_dict
Initial data for a wizard's :class:`~django.forms.Form` objects can be
- provided using the optional :attr:`~Wizard.initial_dict` keyword argument.
- This argument should be a dictionary mapping the steps to dictionaries
- containing the initial data for each step. The dictionary of initial data
- will be passed along to the constructor of the step's
+ provided using the optional :attr:`~WizardView.initial_dict` keyword
+ argument. This argument should be a dictionary mapping the steps to
+ dictionaries containing the initial data for each step. The dictionary of
+ initial data will be passed along to the constructor of the step's
:class:`~django.forms.Form`::
>>> from myapp.forms import ContactForm1, ContactForm2
@@ -542,11 +548,13 @@ Providing initial data for the forms
Handling files
==============
+.. attribute:: WizardView.file_storage
+
To handle :class:`~django.forms.FileField` within any step form of the wizard,
-you have to add a :attr:`file_storage` to your :class:`WizardView` subclass.
+you have to add a ``file_storage`` to your :class:`WizardView` subclass.
This storage will temporarily store the uploaded files for the wizard. The
-:attr:`file_storage` attribute should be a
+``file_storage`` attribute should be a
:class:`~django.core.files.storage.Storage` subclass.
Django provides a built-in storage class (see :ref:`the built-in filesystem
@@ -646,6 +654,8 @@ Usage of ``NamedUrlWizardView``
===============================
.. class:: NamedUrlWizardView
+.. class:: NamedUrlSessionWizardView
+.. class:: NamedUrlCookieWizardView
There is a :class:`WizardView` subclass which adds named-urls support to the
wizard. By doing this, you can have single urls for every step. You can also
diff --git a/docs/ref/contrib/formtools/index.txt b/docs/ref/contrib/formtools/index.txt
index f36470654a..e768c0e655 100644
--- a/docs/ref/contrib/formtools/index.txt
+++ b/docs/ref/contrib/formtools/index.txt
@@ -1,6 +1,8 @@
django.contrib.formtools
========================
+.. module:: django.contrib.formtools
+
A set of high-level abstractions for Django forms (:mod:`django.forms`).
.. toctree::
diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt
index 519f79f0d4..be413c9df8 100644
--- a/docs/ref/contrib/gis/db-api.txt
+++ b/docs/ref/contrib/gis/db-api.txt
@@ -4,20 +4,23 @@
GeoDjango Database API
======================
-.. module:: django.contrib.gis.db.models
- :synopsis: GeoDjango's database API.
-
.. _spatial-backends:
Spatial Backends
================
+.. module:: django.contrib.gis.db.backends
+ :synopsis: GeoDjango's spatial database backends.
+
GeoDjango currently provides the following spatial database backends:
-* :mod:`django.contrib.gis.db.backends.postgis`
-* :mod:`django.contrib.gis.db.backends.mysql`
-* :mod:`django.contrib.gis.db.backends.oracle`
-* :mod:`django.contrib.gis.db.backends.spatialite`
+* ``django.contrib.gis.db.backends.postgis``
+* ``django.contrib.gis.db.backends.mysql``
+* ``django.contrib.gis.db.backends.oracle``
+* ``django.contrib.gis.db.backends.spatialite``
+
+.. module:: django.contrib.gis.db.models
+ :synopsis: GeoDjango's database API.
.. _mysql-spatial-limitations:
diff --git a/docs/ref/contrib/gis/feeds.txt b/docs/ref/contrib/gis/feeds.txt
index 7c3a2d011c..7b1b6ebccf 100644
--- a/docs/ref/contrib/gis/feeds.txt
+++ b/docs/ref/contrib/gis/feeds.txt
@@ -27,7 +27,7 @@ API Reference
.. class:: Feed
In addition to methods provided by
- the :class:`django.contrib.syndication.feeds.Feed`
+ the :class:`django.contrib.syndication.views.Feed`
base class, GeoDjango's ``Feed`` class provides
the following overrides. Note that these overrides may be done in multiple ways::
@@ -71,11 +71,11 @@ API Reference
can be a ``GEOSGeometry`` instance, or a tuple that represents a
point coordinate or bounding box. For example::
- class ZipcodeFeed(Feed):
+ class ZipcodeFeed(Feed):
- def item_geometry(self, obj):
- # Returns the polygon.
- return obj.poly
+ def item_geometry(self, obj):
+ # Returns the polygon.
+ return obj.poly
``SyndicationFeed`` Subclasses
------------------------------
diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt
index 69280dc028..66afc3d377 100644
--- a/docs/ref/contrib/gis/geoquerysets.txt
+++ b/docs/ref/contrib/gis/geoquerysets.txt
@@ -683,7 +683,7 @@ Keyword Argument Description
a method name clashes with an existing
``GeoQuerySet`` method -- if you wanted to use the
``area()`` method on model with a ``PolygonField``
- named ``area``, for example.
+ named ``area``, for example.
===================== =====================================================
Measurement
@@ -1043,7 +1043,7 @@ Keyword Argument Description
===================== =====================================================
``relative`` If set to ``True``, the path data will be implemented
in terms of relative moves. Defaults to ``False``,
- meaning that absolute moves are used instead.
+ meaning that absolute moves are used instead.
``precision`` This keyword may be used to specify the number of
significant digits for the coordinates in the SVG
diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt
index 7d7c32781c..4d44638488 100644
--- a/docs/ref/contrib/gis/geos.txt
+++ b/docs/ref/contrib/gis/geos.txt
@@ -142,10 +142,9 @@ Geometry Objects
.. class:: GEOSGeometry(geo_input[, srid=None])
- :param geo_input: Geometry input value
- :type geo_input: string or buffer
+ :param geo_input: Geometry input value (string or buffer)
:param srid: spatial reference identifier
- :type srid: integer
+ :type srid: int
This is the base class for all GEOS geometry objects. It initializes on the
given ``geo_input`` argument, and then assumes the proper geometry subclass
@@ -800,7 +799,7 @@ Example::
:param string: string that contains spatial data
:type string: string
:param srid: spatial reference identifier
- :type srid: integer
+ :type srid: int
:rtype: a :class:`GEOSGeometry` corresponding to the spatial data in the string
Example::
@@ -966,3 +965,10 @@ location (e.g., ``/home/bob/lib/libgeos_c.so``).
The setting must be the *full* path to the **C** shared library; in
other words you want to use ``libgeos_c.so``, not ``libgeos.so``.
+
+Exceptions
+==========
+
+.. exception:: GEOSException
+
+The base GEOS exception, indicates a GEOS-related error.
diff --git a/docs/ref/contrib/gis/install/index.txt b/docs/ref/contrib/gis/install/index.txt
index 100dc2edd0..35c01c9b7e 100644
--- a/docs/ref/contrib/gis/install/index.txt
+++ b/docs/ref/contrib/gis/install/index.txt
@@ -530,6 +530,6 @@ Finally, :ref:`install Django <installing-official-release>` on your system.
.. rubric:: Footnotes
.. [#] GeoDjango uses the :func:`~ctypes.util.find_library` routine from
- :mod:`ctypes.util` to locate shared libraries.
+ ``ctypes.util`` to locate shared libraries.
.. [#] The ``psycopg2`` Windows installers are packaged and maintained by
`Jason Erickson <http://www.stickpeople.com/projects/python/win-psycopg/>`_.
diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
index 5000622ad4..9efa020e61 100644
--- a/docs/ref/contrib/gis/tutorial.txt
+++ b/docs/ref/contrib/gis/tutorial.txt
@@ -226,7 +226,7 @@ model to represent this data::
class WorldBorder(models.Model):
# Regular Django fields corresponding to the attributes in the
- # world borders shapefile.
+ # world borders shapefile.
name = models.CharField(max_length=50)
area = models.IntegerField()
pop2005 = models.IntegerField('Population 2005')
@@ -236,13 +236,13 @@ model to represent this data::
un = models.IntegerField('United Nations Code')
region = models.IntegerField('Region Code')
subregion = models.IntegerField('Sub-Region Code')
- lon = models.FloatField()
- lat = models.FloatField()
+ lon = models.FloatField()
+ lat = models.FloatField()
- # GeoDjango-specific: a geometry field (MultiPolygonField), and
+ # GeoDjango-specific: a geometry field (MultiPolygonField), and
# overriding the default manager with a GeoManager instance.
- mpoly = models.MultiPolygonField()
- objects = models.GeoManager()
+ mpoly = models.MultiPolygonField()
+ objects = models.GeoManager()
# Returns the string representation of the model.
def __unicode__(self):
@@ -250,7 +250,7 @@ model to represent this data::
Please note two important things:
-1. The ``models`` module is imported from :mod:`django.contrib.gis.db`.
+1. The ``models`` module is imported from ``django.contrib.gis.db``.
2. You must override the model's default manager with
:class:`~django.contrib.gis.db.models.GeoManager` to perform spatial queries.
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 42c4b91bd4..1861318b95 100644
--- a/docs/ref/contrib/sitemaps.txt
+++ b/docs/ref/contrib/sitemaps.txt
@@ -49,6 +49,8 @@ loader can find the default templates.)
Initialization
==============
+.. function:: views.sitemap(request, sitemaps, section=None, template_name='sitemap.xml', mimetype='application/xml')
+
To activate sitemap generation on your Django site, add this line to your
:doc:`URLconf </topics/http/urls>`::
@@ -240,9 +242,9 @@ The sitemap framework provides a couple convenience classes for common cases:
The :class:`django.contrib.sitemaps.GenericSitemap` class allows you to
create a sitemap by passing it a dictionary which has to contain at least
- a :data:`queryset` entry. This queryset will be used to generate the items
- of the sitemap. It may also have a :data:`date_field` entry that
- specifies a date field for objects retrieved from the :data:`queryset`.
+ a ``queryset`` entry. This queryset will be used to generate the items
+ of the sitemap. It may also have a ``date_field`` entry that
+ specifies a date field for objects retrieved from the ``queryset``.
This will be used for the :attr:`~Sitemap.lastmod` attribute in the
generated sitemap. You may also pass :attr:`~Sitemap.priority` and
:attr:`~Sitemap.changefreq` keyword arguments to the
@@ -281,14 +283,16 @@ Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
Creating a sitemap index
========================
+.. function:: views.index(request, sitemaps, template_name='sitemap_index.xml', mimetype='application/xml', sitemap_url_name='django.contrib.sitemaps.views.sitemap')
+
The sitemap framework also has the ability to create a sitemap index that
references individual sitemap files, one per each section defined in your
-:data:`sitemaps` dictionary. The only differences in usage are:
+``sitemaps`` dictionary. The only differences in usage are:
* You use two views in your URLconf: :func:`django.contrib.sitemaps.views.index`
and :func:`django.contrib.sitemaps.views.sitemap`.
* The :func:`django.contrib.sitemaps.views.sitemap` view should take a
- :data:`section` keyword argument.
+ ``section`` keyword argument.
Here's what the relevant URLconf lines would look like for the example above::
@@ -299,7 +303,7 @@ Here's what the relevant URLconf lines would look like for the example above::
This will automatically generate a :file:`sitemap.xml` file that references
both :file:`sitemap-flatpages.xml` and :file:`sitemap-blog.xml`. The
-:class:`~django.contrib.sitemaps.Sitemap` classes and the :data:`sitemaps`
+:class:`~django.contrib.sitemaps.Sitemap` classes and the ``sitemaps``
dict don't change at all.
You should create an index file if one of your sitemaps has more than 50,000
@@ -350,19 +354,20 @@ rendering. For more details, see the :doc:`TemplateResponse documentation
Context variables
------------------
-When customizing the templates for the :func:`~django.contrib.sitemaps.views.index`
-and :func:`~django.contrib.sitemaps.views.sitemaps` views, you can rely on the
+When customizing the templates for the
+:func:`~django.contrib.sitemaps.views.index` and
+:func:`~django.contrib.sitemaps.views.sitemap` views, you can rely on the
following context variables.
Index
-----
-The variable :data:`sitemaps` is a list of absolute URLs to each of the sitemaps.
+The variable ``sitemaps`` is a list of absolute URLs to each of the sitemaps.
Sitemap
-------
-The variable :data:`urlset` is a list of URLs that should appear in the
+The variable ``urlset`` is a list of URLs that should appear in the
sitemap. Each URL exposes attributes as defined in the
:class:`~django.contrib.sitemaps.Sitemap` class:
@@ -411,14 +416,14 @@ that: :func:`django.contrib.sitemaps.ping_google()`.
.. function:: ping_google
- :func:`ping_google` takes an optional argument, :data:`sitemap_url`,
+ :func:`ping_google` takes an optional argument, ``sitemap_url``,
which should be the absolute path to your site's sitemap (e.g.,
:file:`'/sitemap.xml'`). If this argument isn't provided,
:func:`ping_google` will attempt to figure out your
sitemap by performing a reverse looking in your URLconf.
:func:`ping_google` raises the exception
- :exc:`django.contrib.sitemaps.SitemapNotFound` if it cannot determine your
+ ``django.contrib.sitemaps.SitemapNotFound`` if it cannot determine your
sitemap URL.
.. admonition:: Register with Google first!
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 9c8f29a8de..a4a60f239b 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -33,7 +33,7 @@ STATICFILES_DIRS
Default: ``[]``
This setting defines the additional locations the staticfiles app will traverse
-if the :class:`FileSystemFinder` finder is enabled, e.g. if you use the
+if the ``FileSystemFinder`` finder is enabled, e.g. if you use the
:djadmin:`collectstatic` or :djadmin:`findstatic` management command or use the
static file serving view.
@@ -101,19 +101,19 @@ The list of finder backends that know how to find static files in
various locations.
The default will find files stored in the :setting:`STATICFILES_DIRS` setting
-(using :class:`django.contrib.staticfiles.finders.FileSystemFinder`) and in a
+(using ``django.contrib.staticfiles.finders.FileSystemFinder``) and in a
``static`` subdirectory of each app (using
-:class:`django.contrib.staticfiles.finders.AppDirectoriesFinder`)
+``django.contrib.staticfiles.finders.AppDirectoriesFinder``)
One finder is disabled by default:
-:class:`django.contrib.staticfiles.finders.DefaultStorageFinder`. If added to
+``django.contrib.staticfiles.finders.DefaultStorageFinder``. If added to
your :setting:`STATICFILES_FINDERS` setting, it will look for static files in
the default file storage as defined by the :setting:`DEFAULT_FILE_STORAGE`
setting.
.. note::
- When using the :class:`AppDirectoriesFinder` finder, make sure your apps
+ When using the ``AppDirectoriesFinder`` finder, make sure your apps
can be found by staticfiles. Simply add the app to the
:setting:`INSTALLED_APPS` setting of your site.
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
index 2418dba8ef..d0376e3c1b 100644
--- a/docs/ref/contrib/syndication.txt
+++ b/docs/ref/contrib/syndication.txt
@@ -334,7 +334,7 @@ And the accompanying URLconf::
Feed class reference
--------------------
-.. class:: django.contrib.syndication.views.Feed
+.. class:: views.Feed
This example illustrates all possible attributes and methods for a
:class:`~django.contrib.syndication.views.Feed` class::
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 771085766e..e933ee350d 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -259,9 +259,9 @@ recommended solution.
Should you decide to use ``utf8_bin`` collation for some of your tables with
MySQLdb 1.2.1p2 or 1.2.2, you should still use ``utf8_collation_ci_swedish``
-(the default) collation for the :class:`django.contrib.sessions.models.Session`
+(the default) collation for the ``django.contrib.sessions.models.Session``
table (usually called ``django_session``) and the
-:class:`django.contrib.admin.models.LogEntry` table (usually called
+``django.contrib.admin.models.LogEntry`` table (usually called
``django_admin_log``). Those are the two standard tables that use
:class:`~django.db.models.TextField` internally.
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index e67527de23..8d612ae6a6 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -292,6 +292,8 @@ Searches for and loads the contents of the named fixture into the database.
The :djadminopt:`--database` option can be used to specify the database
onto which the data will be loaded.
+.. django-admin-option:: --ignorenonexistent
+
.. versionadded:: 1.5
The :djadminopt:`--ignorenonexistent` option can be used to ignore fields that
diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt
index e91a5dd85e..f123ae2e59 100644
--- a/docs/ref/exceptions.txt
+++ b/docs/ref/exceptions.txt
@@ -131,6 +131,21 @@ The Django wrappers for database exceptions behave exactly the same as
the underlying database exceptions. See :pep:`249`, the Python Database API
Specification v2.0, for further information.
+.. exception:: models.ProtectedError
+
+Raised to prevent deletion of referenced objects when using
+:attr:`django.db.models.PROTECT`. Subclass of :exc:`IntegrityError`.
+
+.. currentmodule:: django.http
+
+Http Exceptions
+===============
+
+.. exception:: UnreadablePostError
+
+ The :exc:`UnreadablePostError` is raised when a user cancels an upload.
+ It is available from :mod:`django.http`.
+
.. currentmodule:: django.db.transaction
Transaction Exceptions
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt
index ada614df45..7562f9b6bf 100644
--- a/docs/ref/files/file.txt
+++ b/docs/ref/files/file.txt
@@ -14,7 +14,7 @@ The ``File`` Class
The :class:`File` is a thin wrapper around Python's built-in file object
with some Django-specific additions. Internally, Django uses this class
any time it needs to represent a file.
-
+
:class:`File` objects have the following attributes and methods:
.. attribute:: name
@@ -148,7 +148,7 @@ below) will also have a couple of extra methods:
Note that the ``content`` argument must be an instance of either
:class:`File` or of a subclass of :class:`File`, such as
- :class:`ContentFile`.
+ :class:`~django.core.files.base.ContentFile`.
.. method:: File.delete([save=True])
diff --git a/docs/ref/files/storage.txt b/docs/ref/files/storage.txt
index f9bcf9b61e..ff175d122b 100644
--- a/docs/ref/files/storage.txt
+++ b/docs/ref/files/storage.txt
@@ -38,7 +38,7 @@ The FileSystemStorage Class
.. note::
- The :class:`FileSystemStorage.delete` method will not raise
+ The ``FileSystemStorage.delete()`` method will not raise
raise an exception if the given file name does not exist.
The Storage Class
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt
index ab1f4b0eea..4aacbf0a0d 100644
--- a/docs/ref/forms/api.txt
+++ b/docs/ref/forms/api.txt
@@ -2,9 +2,7 @@
The Forms API
=============
-.. module:: django.forms.forms
-
-.. currentmodule:: django.forms
+.. module:: django.forms
.. admonition:: About this document
@@ -380,6 +378,9 @@ a form object, and each rendering method returns a Unicode object.
Styling required or erroneous form rows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. attribute:: Form.error_css_class
+.. attribute:: Form.required_css_class
+
It's pretty common to style form rows and fields that are required or have
errors. For example, you might want to present required form rows in bold and
highlight errors in red.
@@ -587,24 +588,24 @@ lazy developers -- they're not the only way a form object can be displayed.
Used to display HTML or access attributes for a single field of a
:class:`Form` instance.
- The :meth:`__unicode__` and :meth:`__str__` methods of this object displays
+ The ``__unicode__()`` and ``__str__()`` methods of this object displays
the HTML for this field.
To retrieve a single ``BoundField``, use dictionary lookup syntax on your form
using the field's name as the key::
- >>> form = ContactForm()
- >>> print(form['subject'])
- <input id="id_subject" type="text" name="subject" maxlength="100" />
+ >>> form = ContactForm()
+ >>> print(form['subject'])
+ <input id="id_subject" type="text" name="subject" maxlength="100" />
To retrieve all ``BoundField`` objects, iterate the form::
- >>> form = ContactForm()
- >>> for boundfield in form: print(boundfield)
- <input id="id_subject" type="text" name="subject" maxlength="100" />
- <input type="text" name="message" id="id_message" />
- <input type="text" name="sender" id="id_sender" />
- <input type="checkbox" name="cc_myself" id="id_cc_myself" />
+ >>> form = ContactForm()
+ >>> for boundfield in form: print(boundfield)
+ <input id="id_subject" type="text" name="subject" maxlength="100" />
+ <input type="text" name="message" id="id_message" />
+ <input type="text" name="sender" id="id_sender" />
+ <input type="checkbox" name="cc_myself" id="id_cc_myself" />
The field-specific output honors the form object's ``auto_id`` setting::
@@ -635,7 +636,7 @@ For a field's list of errors, access the field's ``errors`` attribute.
>>> print(f['subject'].errors)
>>> str(f['subject'].errors)
- ''
+ ''
.. method:: BoundField.css_classes()
@@ -644,17 +645,17 @@ indicate required form fields or fields that contain errors. If you're
manually rendering a form, you can access these CSS classes using the
``css_classes`` method::
- >>> f = ContactForm(data)
- >>> f['message'].css_classes()
- 'required'
+ >>> f = ContactForm(data)
+ >>> f['message'].css_classes()
+ 'required'
If you want to provide some additional classes in addition to the
error and required classes that may be required, you can provide
those classes as an argument::
- >>> f = ContactForm(data)
- >>> f['message'].css_classes('foo bar')
- 'foo bar required'
+ >>> f = ContactForm(data)
+ >>> f['message'].css_classes('foo bar')
+ 'foo bar required'
.. method:: BoundField.value()
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index d8d9c9b770..bc1270094b 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -508,9 +508,9 @@ Selector and checkbox widgets
.. attribute:: Select.choices
- This attribute is optional when the field does not have a
- :attr:`~Field.choices` attribute. If it does, it will override anything
- you set here when the attribute is updated on the :class:`Field`.
+ This attribute is optional when the form field does not have a
+ ``choices`` attribute. If it does, it will override anything you set
+ here when the attribute is updated on the :class:`Field`.
``NullBooleanSelect``
~~~~~~~~~~~~~~~~~~~~~
@@ -660,9 +660,9 @@ Composite widgets
.. attribute:: MultipleHiddenInput.choices
- This attribute is optional when the field does not have a
- :attr:`~Field.choices` attribute. If it does, it will override anything
- you set here when the attribute is updated on the :class:`Field`.
+ This attribute is optional when the form field does not have a
+ ``choices`` attribute. If it does, it will override anything you set
+ here when the attribute is updated on the :class:`Field`.
``SplitDateTimeWidget``
~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt
index 31cc6f24f6..2b053d80ab 100644
--- a/docs/ref/middleware.txt
+++ b/docs/ref/middleware.txt
@@ -111,7 +111,7 @@ It will NOT compress content if any of the following are true:
not to be performed on certain content types.
You can apply GZip compression to individual views using the
-:func:`~django.views.decorators.http.gzip_page()` decorator.
+:func:`~django.views.decorators.gzip.gzip_page()` decorator.
Conditional GET middleware
--------------------------
@@ -124,7 +124,7 @@ Conditional GET middleware
Handles conditional GET operations. If the response has a ``ETag`` or
``Last-Modified`` header, and the request has ``If-None-Match`` or
``If-Modified-Since``, the response is replaced by an
-:class:`~django.http.HttpNotModified`.
+:class:`~django.http.HttpResponseNotModified`.
Also sets the ``Date`` and ``Content-Length`` response-headers.
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index e9f85e0657..6498b6c845 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -113,7 +113,7 @@ define a suitably-named constant for each value::
default=FRESHMAN)
def is_upperclass(self):
- return self.year_in_school in (self.JUNIOR, self.SENIOR)
+ return self.year_in_school in (self.JUNIOR, self.SENIOR)
Though you can define a choices list outside of a model class and then
refer to it, defining the choices and names for each choice inside the
@@ -509,8 +509,8 @@ Has one **required** argument:
.. attribute:: FileField.upload_to
A local filesystem path that will be appended to your :setting:`MEDIA_ROOT`
- setting to determine the value of the :attr:`~django.core.files.File.url`
- attribute.
+ setting to determine the value of the
+ :attr:`~django.db.models.fields.files.FieldFile.url` attribute.
This path may contain :func:`~time.strftime` formatting, which will be
replaced by the date/time of the file upload (so that uploaded files don't
@@ -564,9 +564,9 @@ takes a few steps:
3. All that will be stored in your database is a path to the file
(relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the
- convenience :attr:`~django.core.files.File.url` function provided by
- Django. For example, if your :class:`ImageField` is called ``mug_shot``,
- you can get the absolute path to your image in a template with
+ convenience :attr:`~django.db.models.fields.files.FieldFile.url` attribute
+ provided by Django. For example, if your :class:`ImageField` is called
+ ``mug_shot``, you can get the absolute path to your image in a template with
``{{ object.mug_shot.url }}``.
For example, say your :setting:`MEDIA_ROOT` is set to ``'/home/media'``, and
@@ -589,7 +589,7 @@ topic guide.
saved.
The uploaded file's relative URL can be obtained using the
-:attr:`~django.db.models.FileField.url` attribute. Internally,
+:attr:`~django.db.models.fields.files.FieldFile.url` attribute. Internally,
this calls the :meth:`~django.core.files.storage.Storage.url` method of the
underlying :class:`~django.core.files.storage.Storage` class.
@@ -614,9 +614,20 @@ can change the maximum length using the :attr:`~CharField.max_length` argument.
FileField and FieldFile
~~~~~~~~~~~~~~~~~~~~~~~
-When you access a :class:`FileField` on a model, you are given an instance
-of :class:`FieldFile` as a proxy for accessing the underlying file. This
-class has several methods that can be used to interact with file data:
+.. currentmodule:: django.db.models.fields.files
+
+.. class:: FieldFile
+
+When you access a :class:`~django.db.models.FileField` on a model, you are
+given an instance of :class:`FieldFile` as a proxy for accessing the underlying
+file. This class has several attributes and methods that can be used to
+interact with file data:
+
+.. attribute:: FieldFile.url
+
+A read-only property to access the file's relative URL by calling the
+:meth:`~django.core.files.storage.Storage.url` method of the underlying
+:class:`~django.core.files.storage.Storage` class.
.. method:: FieldFile.open(mode='rb')
@@ -632,9 +643,9 @@ associated with this instance.
This method takes a filename and file contents and passes them to the storage
class for the field, then associates the stored file with the model field.
-If you want to manually associate file data with :class:`FileField`
-instances on your model, the ``save()`` method is used to persist that file
-data.
+If you want to manually associate file data with
+:class:`~django.db.models.FileField` instances on your model, the ``save()``
+method is used to persist that file data.
Takes two required arguments: ``name`` which is the name of the file, and
``content`` which is an object containing the file's contents. The
@@ -672,6 +683,8 @@ to cleanup orphaned files, you'll need to handle it yourself (for instance,
with a custom management command that can be run manually or scheduled to run
periodically via e.g. cron).
+.. currentmodule:: django.db.models
+
``FilePathField``
-----------------
@@ -759,8 +772,7 @@ Inherits all attributes and methods from :class:`FileField`, but also
validates that the uploaded object is a valid image.
In addition to the special attributes that are available for :class:`FileField`,
-an :class:`ImageField` also has :attr:`~django.core.files.File.height` and
-:attr:`~django.core.files.File.width` attributes.
+an :class:`ImageField` also has ``height`` and ``width`` attributes.
To facilitate querying on those attributes, :class:`ImageField` has two extra
optional arguments:
@@ -1047,26 +1059,36 @@ define the details of how the relation works.
user = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
- The possible values for :attr:`on_delete` are found in
- :mod:`django.db.models`:
+The possible values for :attr:`~ForeignKey.on_delete` are found in
+:mod:`django.db.models`:
- * :attr:`~django.db.models.CASCADE`: Cascade deletes; the default.
+* .. attribute:: CASCADE
- * :attr:`~django.db.models.PROTECT`: Prevent deletion of the referenced
- object by raising :exc:`django.db.models.ProtectedError`, a subclass of
- :exc:`django.db.IntegrityError`.
+ Cascade deletes; the default.
- * :attr:`~django.db.models.SET_NULL`: Set the :class:`ForeignKey` null;
- this is only possible if :attr:`null` is ``True``.
+* .. attribute:: PROTECT
- * :attr:`~django.db.models.SET_DEFAULT`: Set the :class:`ForeignKey` to its
- default value; a default for the :class:`ForeignKey` must be set.
+ Prevent deletion of the referenced object by raising
+ :exc:`~django.db.models.ProtectedError`, a subclass of
+ :exc:`django.db.IntegrityError`.
- * :func:`~django.db.models.SET()`: Set the :class:`ForeignKey` to the value
- passed to :func:`~django.db.models.SET()`, or if a callable is passed in,
- the result of calling it. In most cases, passing a callable will be
- necessary to avoid executing queries at the time your models.py is
- imported::
+* .. attribute:: SET_NULL
+
+ Set the :class:`ForeignKey` null; this is only possible if
+ :attr:`~Field.null` is ``True``.
+
+* .. attribute:: SET_DEFAULT
+
+ Set the :class:`ForeignKey` to its default value; a default for the
+ :class:`ForeignKey` must be set.
+
+* .. function:: SET()
+
+ Set the :class:`ForeignKey` to the value passed to
+ :func:`~django.db.models.SET()`, or if a callable is passed in,
+ the result of calling it. In most cases, passing a callable will be
+ necessary to avoid executing queries at the time your models.py is
+ imported::
def get_sentinel_user():
return User.objects.get_or_create(username='deleted')[0]
@@ -1074,11 +1096,12 @@ define the details of how the relation works.
class MyModel(models.Model):
user = models.ForeignKey(User, on_delete=models.SET(get_sentinel_user))
- * :attr:`~django.db.models.DO_NOTHING`: Take no action. If your database
- backend enforces referential integrity, this will cause an
- :exc:`~django.db.IntegrityError` unless you manually add a SQL ``ON
- DELETE`` constraint to the database field (perhaps using
- :ref:`initial sql<initial-sql>`).
+* .. attribute:: DO_NOTHING
+
+ Take no action. If your database backend enforces referential
+ integrity, this will cause an :exc:`~django.db.IntegrityError` unless
+ you manually add a SQL ``ON DELETE`` constraint to the database field
+ (perhaps using :ref:`initial sql<initial-sql>`).
.. _ref-manytomany:
diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt
index 6fd707fdf2..b349197a5b 100644
--- a/docs/ref/models/options.txt
+++ b/docs/ref/models/options.txt
@@ -100,7 +100,7 @@ Django quotes column and table names behind the scenes.
.. attribute:: Options.managed
Defaults to ``True``, meaning Django will create the appropriate database
- tables in :djadmin:`syncdb` and remove them as part of a :djadmin:`reset`
+ tables in :djadmin:`syncdb` and remove them as part of a :djadmin:`flush`
management command. That is, Django *manages* the database tables'
lifecycles.
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index a8e0ef3f51..2b4397a138 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -263,7 +263,7 @@ Methods
.. method:: HttpRequest.get_signed_cookie(key, default=RAISE_ERROR, salt='', max_age=None)
Returns a cookie value for a signed cookie, or raises a
- :class:`~django.core.signing.BadSignature` exception if the signature is
+ ``django.core.signing.BadSignature`` exception if the signature is
no longer valid. If you provide the ``default`` argument the exception
will be suppressed and that default value will be returned instead.
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index bfe283cc68..be21f06de7 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2159,7 +2159,7 @@ startproject <startproject>` management command will create a simple
``wsgi.py`` file with an ``application`` callable in it, and point this setting
to that ``application``.
-If not set, the return value of :func:`django.core.wsgi.get_wsgi_application`
+If not set, the return value of ``django.core.wsgi.get_wsgi_application()``
will be used. In this case, the behavior of :djadmin:`runserver` will be
identical to previous Django versions.
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
index f2f1459bf0..0995789391 100644
--- a/docs/ref/signals.txt
+++ b/docs/ref/signals.txt
@@ -436,9 +436,8 @@ Sent when Django begins processing an HTTP request.
Arguments sent with this signal:
``sender``
- The handler class -- e.g.
- :class:`django.core.handlers.wsgi.WsgiHandler` -- that handled
- the request.
+ The handler class -- e.g. ``django.core.handlers.wsgi.WsgiHandler`` -- that
+ handled the request.
request_finished
----------------
@@ -496,7 +495,7 @@ setting_changed
:module:
This signal is sent when the value of a setting is changed through the
-:meth:`django.test.TestCase.setting` context manager or the
+``django.test.TestCase.settings()`` context manager or the
:func:`django.test.utils.override_settings` decorator/context manager.
It's actually sent twice: when the new value is applied ("setup") and when the
@@ -558,8 +557,8 @@ Arguments sent with this signal:
``sender``
The database wrapper class -- i.e.
- :class:`django.db.backends.postgresql_psycopg2.DatabaseWrapper` or
- :class:`django.db.backends.mysql.DatabaseWrapper`, etc.
+ ``django.db.backends.postgresql_psycopg2.DatabaseWrapper`` or
+ ``django.db.backends.mysql.DatabaseWrapper``, etc.
``connection``
The database connection that was opened. This can be used in a
diff --git a/docs/ref/template-response.txt b/docs/ref/template-response.txt
index d9b7130362..3f5e772737 100644
--- a/docs/ref/template-response.txt
+++ b/docs/ref/template-response.txt
@@ -121,15 +121,14 @@ Methods
used as the response instead of the original response object (and
will be passed to the next post rendering callback etc.)
-.. method:: SimpleTemplateResponse.render():
+.. method:: SimpleTemplateResponse.render()
- Sets :attr:`response.content` to the result obtained by
+ Sets ``response.content`` to the result obtained by
:attr:`SimpleTemplateResponse.rendered_content`, runs all post-rendering
callbacks, and returns the resulting response object.
- :meth:`~SimpleTemplateResponse.render()` will only have an effect
- the first time it is called. On subsequent calls, it will return
- the result obtained from the first call.
+ ``render()`` will only have an effect the first time it is called. On
+ subsequent calls, it will return the result obtained from the first call.
TemplateResponse objects
@@ -188,24 +187,23 @@ returned to the client, it must be rendered. The rendering process takes the
intermediate representation of template and context, and turns it into the
final byte stream that can be served to the client.
-There are three circumstances under which a TemplateResponse will be
+There are three circumstances under which a ``TemplateResponse`` will be
rendered:
-* When the TemplateResponse instance is explicitly rendered, using
+* When the ``TemplateResponse`` instance is explicitly rendered, using
the :meth:`SimpleTemplateResponse.render()` method.
* When the content of the response is explicitly set by assigning
- :attr:`response.content`.
+ ``response.content``.
* After passing through template response middleware, but before
passing through response middleware.
-A TemplateResponse can only be rendered once. The first call to
-:meth:`SimpleTemplateResponse.render` sets the content of the
-response; subsequent rendering calls do not change the response
-content.
+A ``TemplateResponse`` can only be rendered once. The first call to
+:meth:`SimpleTemplateResponse.render` sets the content of the response;
+subsequent rendering calls do not change the response content.
-However, when :attr:`response.content` is explicitly assigned, the
+However, when ``response.content`` is explicitly assigned, the
change is always applied. If you want to force the content to be
re-rendered, you can re-evaluate the rendered content, and assign
the content of the response manually::
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index 7c17f0a758..0162f78eed 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -557,15 +557,17 @@ Note that these paths should use Unix-style forward slashes, even on Windows.
The Python API
~~~~~~~~~~~~~~
-Django has two ways to load templates from files:
+.. module:: django.template.loader
-.. function:: django.template.loader.get_template(template_name)
+``django.template.loader`` has two functions to load templates from files:
+
+.. function:: get_template(template_name)
``get_template`` returns the compiled template (a ``Template`` object) for
the template with the given name. If the template doesn't exist, it raises
``django.template.TemplateDoesNotExist``.
-.. function:: django.template.loader.select_template(template_name_list)
+.. function:: select_template(template_name_list)
``select_template`` is just like ``get_template``, except it takes a list
of template names. Of the list, it returns the first template that exists.
@@ -630,11 +632,19 @@ by editing your :setting:`TEMPLATE_LOADERS` setting. :setting:`TEMPLATE_LOADERS`
should be a tuple of strings, where each string represents a template loader
class. Here are the template loaders that come with Django:
+.. currentmodule:: django.template.loaders
+
``django.template.loaders.filesystem.Loader``
+
+.. class:: filesystem.Loader
+
Loads templates from the filesystem, according to :setting:`TEMPLATE_DIRS`.
This loader is enabled by default.
``django.template.loaders.app_directories.Loader``
+
+.. class:: app_directories.Loader
+
Loads templates from Django apps on the filesystem. For each app in
:setting:`INSTALLED_APPS`, the loader looks for a ``templates``
subdirectory. If the directory exists, Django looks for templates in there.
@@ -669,12 +679,18 @@ class. Here are the template loaders that come with Django:
This loader is enabled by default.
``django.template.loaders.eggs.Loader``
+
+.. class:: eggs.Loader
+
Just like ``app_directories`` above, but it loads templates from Python
eggs rather than from the filesystem.
This loader is disabled by default.
``django.template.loaders.cached.Loader``
+
+.. class:: cached.Loader
+
By default, the templating system will read and compile your templates every
time they need to be rendered. While the Django templating system is quite
fast, the overhead from reading and compiling templates can add up.
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index aab53aed0c..cfc57cc551 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -377,7 +377,7 @@ block are output::
In the above, if ``athlete_list`` is not empty, the number of athletes will be
displayed by the ``{{ athlete_list|length }}`` variable.
-As you can see, the ``if`` tag may take one or several `` {% elif %}``
+As you can see, the ``if`` tag may take one or several ``{% elif %}``
clauses, as well as an ``{% else %}`` clause that will be displayed if all
previous conditions fail. These clauses are optional.
diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt
index 5a0b04f9fa..92b41b8fea 100644
--- a/docs/ref/urls.txt
+++ b/docs/ref/urls.txt
@@ -86,7 +86,6 @@ include()
application and instance namespaces.
:arg module: URLconf module (or module name)
- :type module: Module or string
:arg namespace: Instance namespace for the URL entries being included
:type namespace: string
:arg app_name: Application namespace for the URL entries being included
@@ -142,4 +141,3 @@ value should suffice.
See the documentation about :ref:`the 500 (HTTP Internal Server Error) view
<http_internal_server_error_view>` for more information.
-
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 942cac2650..de805173d7 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -190,8 +190,7 @@ The functions defined in this module share the following properties:
Like ``decorator_from_middleware``, but returns a function
that accepts the arguments to be passed to the middleware_class.
For example, the :func:`~django.views.decorators.cache.cache_page`
- decorator is created from the
- :class:`~django.middleware.cache.CacheMiddleware` like this::
+ decorator is created from the ``CacheMiddleware`` like this::
cache_page = decorator_from_middleware_with_args(CacheMiddleware)
@@ -282,15 +281,15 @@ The functions defined in this module share the following properties:
.. function:: smart_str(s, encoding='utf-8', strings_only=False, errors='strict')
Alias of :func:`smart_bytes` on Python 2 and :func:`smart_text` on Python
- 3. This function returns a :class:`str` or a lazy string.
+ 3. This function returns a ``str`` or a lazy string.
- For instance, this is suitable for writing to :attr:`sys.stdout` on
+ For instance, this is suitable for writing to :data:`sys.stdout` on
Python 2 and 3.
.. function:: force_str(s, encoding='utf-8', strings_only=False, errors='strict')
Alias of :func:`force_bytes` on Python 2 and :func:`force_text` on Python
- 3. This function always returns a :class:`str`.
+ 3. This function always returns a ``str``.
.. function:: iri_to_uri(iri)
@@ -624,12 +623,12 @@ escaping HTML.
.. function:: base36_to_int(s)
Converts a base 36 string to an integer. On Python 2 the output is
- guaranteed to be an :class:`int` and not a :class:`long`.
+ guaranteed to be an ``int`` and not a ``long``.
.. function:: int_to_base36(i)
Converts a positive integer to a base 36 string. On Python 2 ``i`` must be
- smaller than :attr:`sys.maxint`.
+ smaller than :data:`sys.maxint`.
``django.utils.safestring``
===========================
@@ -647,12 +646,12 @@ appropriate entities.
.. versionadded:: 1.5
- A :class:`bytes` subclass that has been specifically marked as "safe"
+ A ``bytes`` subclass that has been specifically marked as "safe"
(requires no further escaping) for HTML output purposes.
.. class:: SafeString
- A :class:`str` subclass that has been specifically marked as "safe"
+ A ``str`` subclass that has been specifically marked as "safe"
(requires no further escaping) for HTML output purposes. This is
:class:`SafeBytes` on Python 2 and :class:`SafeText` on Python 3.
@@ -660,7 +659,7 @@ appropriate entities.
.. versionadded:: 1.5
- A :class:`str` (in Python 3) or :class:`unicode` (in Python 2) subclass
+ A ``str`` (in Python 3) or ``unicode`` (in Python 2) subclass
that has been specifically marked as "safe" for HTML output purposes.
.. class:: SafeUnicode
diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt
index 0536b03d64..8da134a42d 100644
--- a/docs/ref/validators.txt
+++ b/docs/ref/validators.txt
@@ -118,7 +118,7 @@ to, or in lieu of custom ``field.clean()`` methods.
.. data:: validate_ipv6_address
- Uses :mod:`django.utils.ipv6` to check the validity of an IPv6 address.
+ Uses ``django.utils.ipv6`` to check the validity of an IPv6 address.
``validate_ipv46_address``
--------------------------