summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-12-30 06:14:39 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-12-30 06:14:39 +0000
commit5a01f848cab3acecf7be93848d935537b8dcfb0e (patch)
tree2ae33328cbb585434e901ef6d53fcb128dbf82ea
parent08f3969d5eb0e87094fe44a877634251285fed59 (diff)
Updated docstring in model_forms unit test
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4263 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/modeltests/model_forms/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index f9cbce996f..7ce89c61a6 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -1,7 +1,8 @@
"""
34. Generating HTML forms from models
-Django provides shortcuts for creating Form objects from a model class.
+Django provides shortcuts for creating Form objects from a model class and a
+model instance.
The function django.newforms.form_for_model() takes a model class and returns
a Form that is tied to the model. This Form works just like any other Form,
@@ -9,6 +10,13 @@ with one additional method: create(). The create() method creates an instance
of the model and returns that newly created instance. It saves the instance to
the database if create(save=True), which is default. If you pass
create(save=False), then you'll get the object without saving it.
+
+The function django.newforms.form_for_instance() takes a model instance and
+returns a Form that is tied to the instance. This form works just like any
+other Form, with one additional method: apply_changes(). The apply_changes()
+method updates the model instance. It saves the changes to the database if
+apply_changes(save=True), which is default. If you pass save=False, then you'll
+get the object without saving it.
"""
from django.db import models