Changeset 4263
- Timestamp:
- 12/30/06 00:14:39 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/modeltests/model_forms/models.py
r4261 r4263 2 2 34. Generating HTML forms from models 3 3 4 Django provides shortcuts for creating Form objects from a model class. 4 Django provides shortcuts for creating Form objects from a model class and a 5 model instance. 5 6 6 7 The function django.newforms.form_for_model() takes a model class and returns … … 10 11 the database if create(save=True), which is default. If you pass 11 12 create(save=False), then you'll get the object without saving it. 13 14 The function django.newforms.form_for_instance() takes a model instance and 15 returns a Form that is tied to the instance. This form works just like any 16 other Form, with one additional method: apply_changes(). The apply_changes() 17 method updates the model instance. It saves the changes to the database if 18 apply_changes(save=True), which is default. If you pass save=False, then you'll 19 get the object without saving it. 12 20 """ 13 21
