Changeset 8022
- Timestamp:
- 07/21/08 11:56:52 (1 month ago)
- Files:
-
- django/trunk/docs/admin.txt (modified) (2 diffs)
- django/trunk/docs/forms.txt (modified) (4 diffs)
- django/trunk/docs/generic_views.txt (modified) (8 diffs)
- django/trunk/docs/modelforms.txt (modified) (3 diffs)
- django/trunk/docs/testing.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/admin.txt
r8010 r8022 495 495 apply as `regular media definitions on forms`_. 496 496 497 .. _regular media definitions on forms: ../ newforms/#media497 .. _regular media definitions on forms: ../forms/#media 498 498 499 499 ``InlineModelAdmin`` objects … … 559 559 to the initial forms. See the `formsets documentation`_ for more information. 560 560 561 .. _formsets documentation: ../ newforms/#formsets561 .. _formsets documentation: ../forms/#formsets 562 562 563 563 ``max_num`` django/trunk/docs/forms.txt
r8020 r8022 2192 2192 form:: 2193 2193 2194 >>> from django import newforms asforms2194 >>> from django import forms 2195 2195 >>> class ArticleForm(forms.Form): 2196 2196 ... title = forms.CharField() … … 2200 2200 a formset of out of an ``ArticleForm`` you would do:: 2201 2201 2202 >>> from django. newforms.formsets import formset_factory2202 >>> from django.forms.formsets import formset_factory 2203 2203 >>> ArticleFormSet = formset_factory(ArticleForm) 2204 2204 … … 2309 2309 Traceback (most recent call last): 2310 2310 ... 2311 django. newforms.util.ValidationError: [u'ManagementForm data is missing or has been tampered with']2311 django.forms.util.ValidationError: [u'ManagementForm data is missing or has been tampered with'] 2312 2312 2313 2313 It is used to keep track of how many form instances are being displayed. If … … 2321 2321 is where you define your own validation that deals at the formset level:: 2322 2322 2323 >>> from django. newforms.formsets import BaseFormSet2323 >>> from django.forms.formsets import BaseFormSet 2324 2324 2325 2325 >>> class BaseArticleFormSet(BaseFormSet): django/trunk/docs/generic_views.txt
r8020 r8022 818 818 819 819 For more on pagination, read the `pagination documentation`_. 820 820 821 821 .. _`pagination documentation`: ../pagination/ 822 822 … … 910 910 911 911 ``django.views.generic.create_update.create_object`` and 912 ``django.views.generic.create_update.update_object`` now use `newforms`_ to913 build and display the form.914 915 .. _ newforms: ../newforms/912 ``django.views.generic.create_update.update_object`` now use the new `forms 913 library`_ to build and display the form. 914 915 .. _forms library: ../forms/ 916 916 917 917 ``django.views.generic.create_update.create_object`` … … 928 928 929 929 If you provide ``form_class``, it should be a 930 ``django. newforms.ModelForm`` subclass. Use this argument when you need930 ``django.forms.ModelForm`` subclass. Use this argument when you need 931 931 to customize the model's form. See the `ModelForm docs`_ for more 932 932 information. … … 974 974 In addition to ``extra_context``, the template's context will be: 975 975 976 * ``form``: A ``django. newforms.ModelForm`` instance representing the form976 * ``form``: A ``django.forms.ModelForm`` instance representing the form 977 977 for creating the object. This lets you refer to form fields easily in the 978 978 template system. … … 989 989 990 990 .. _authentication system: ../authentication/ 991 .. _ModelForm docs: ../ newforms/modelforms991 .. _ModelForm docs: ../forms/modelforms 992 992 .. _forms documentation: ../forms/ 993 993 … … 1006 1006 1007 1007 If you provide ``form_class``, it should be a 1008 ``django. newforms.ModelForm`` subclass. Use this argument when you need1008 ``django.forms.ModelForm`` subclass. Use this argument when you need 1009 1009 to customize the model's form. See the `ModelForm docs`_ for more 1010 1010 information. … … 1064 1064 In addition to ``extra_context``, the template's context will be: 1065 1065 1066 * ``form``: A ``django. newforms.ModelForm`` instance representing the form1066 * ``form``: A ``django.forms.ModelForm`` instance representing the form 1067 1067 for editing the object. This lets you refer to form fields easily in the 1068 1068 template system. … … 1075 1075 </form> 1076 1076 1077 See the ` newforms documentation`_ for more information about using1077 See the `forms documentation`_ for more information about using 1078 1078 ``Form`` objects in templates. 1079 1079 django/trunk/docs/modelforms.txt
r8020 r8022 385 385 ``Author`` model from above:: 386 386 387 >>> from django. newforms.models import modelformset_factory387 >>> from django.forms.models import modelformset_factory 388 388 >>> AuthorFormSet = modelformset_factory(Author) 389 389 … … 418 418 Alternatively, you can use a subclassing based approach:: 419 419 420 from django. newforms.models import BaseModelFormSet420 from django.forms.models import BaseModelFormSet 421 421 422 422 class BaseAuthorFormSet(BaseModelFormSet): … … 495 495 books of a specific author. Here is how you could accomplish this:: 496 496 497 >>> from django. newforms.models import inlineformset_factory497 >>> from django.forms.models import inlineformset_factory 498 498 >>> BookFormSet = inlineformset_factory(Author, Book) 499 499 >>> author = Author.objects.get(name=u'Orson Scott Card') django/trunk/docs/testing.txt
r7913 r8022 865 865 866 866 ``form`` is the name the ``Form`` instance was given in the template 867 context. Note that this works only for `` newforms.Form`` instances, not867 context. Note that this works only for ``forms.Form`` instances, not 868 868 ``oldforms.Form`` instances. 869 869
