Author: adrian Date: 2006-12-30 00:14:39 -0600 (Sat, 30 Dec 2006) New Revision: 4263
Modified: django/trunk/tests/modeltests/model_forms/models.py Log: Updated docstring in model_forms unit test Modified: django/trunk/tests/modeltests/model_forms/models.py =================================================================== --- django/trunk/tests/modeltests/model_forms/models.py 2006-12-30 00:39:41 UTC (rev 4262) +++ django/trunk/tests/modeltests/model_forms/models.py 2006-12-30 06:14:39 UTC (rev 4263) @@ -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 @@ 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
