summaryrefslogtreecommitdiff
path: root/docs/topics/class-based-views
diff options
context:
space:
mode:
authorElif T. Kus <elifkus@gmail.com>2016-01-03 12:56:22 +0200
committerTim Graham <timograham@gmail.com>2016-01-22 12:12:17 -0500
commitbca9faae95db2a92e540fbd08505c134639916fe (patch)
tree92b34dd8ecf8cf5432c25d43292ebc83b7919350 /docs/topics/class-based-views
parent79d0a4fdb0d13ba6a843dace2b90ab44e856bd85 (diff)
Fixed #26020 -- Normalized header stylings in docs.
Diffstat (limited to 'docs/topics/class-based-views')
-rw-r--r--docs/topics/class-based-views/generic-display.txt2
-rw-r--r--docs/topics/class-based-views/generic-editing.txt9
2 files changed, 5 insertions, 6 deletions
diff --git a/docs/topics/class-based-views/generic-display.txt b/docs/topics/class-based-views/generic-display.txt
index a4bb3a190a..0c3ac0b742 100644
--- a/docs/topics/class-based-views/generic-display.txt
+++ b/docs/topics/class-based-views/generic-display.txt
@@ -1,5 +1,3 @@
-.. _Generic views:
-
==================================
Built-in class-based generic views
==================================
diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt
index f5fa2ffcdb..0a1cd06961 100644
--- a/docs/topics/class-based-views/generic-editing.txt
+++ b/docs/topics/class-based-views/generic-editing.txt
@@ -1,3 +1,4 @@
+====================================
Form handling with class-based views
====================================
@@ -13,7 +14,7 @@ this, Django provides a collection of generic class-based views for form
processing.
Basic Forms
------------
+===========
Given a simple contact form:
@@ -60,7 +61,7 @@ Notes:
redirects to the :attr:`~django.views.generic.edit.FormMixin.success_url`.
Model Forms
------------
+===========
Generic views really shine when working with models. These generic
views will automatically create a :class:`~django.forms.ModelForm`, so long as
@@ -180,7 +181,7 @@ Finally, we hook these new views into the URLconf:
on your view class.
Models and request.user
------------------------
+=======================
To track the user that created an object using a :class:`CreateView`,
you can use a custom :class:`~django.forms.ModelForm` to do this. First, add
@@ -223,7 +224,7 @@ alternatively handle unauthorized users in the
:meth:`~django.views.generic.edit.ModelFormMixin.form_valid()`.
AJAX example
-------------
+============
Here is a simple example showing how you might go about implementing a form that
works for AJAX requests as well as 'normal' form POSTs::