Ticket #14392: 14392.patch
File 14392.patch, 1.1 KB (added by , 14 years ago) |
---|
-
docs/topics/forms/modelforms.txt
387 387 class AuthorForm(ModelForm): 388 388 class Meta: 389 389 model = Author 390 fields = ['name', 'title', 'birth_date']390 fields = ('name', 'title', 'birth_date') 391 391 widgets = { 392 392 'name': Textarea(attrs={'cols': 80, 'rows': 20}), 393 393 } … … 471 471 >>> class BookForm(ModelForm): 472 472 ... class Meta: 473 473 ... model = Book 474 ... fields = ['title', 'author']474 ... fields = ('title', 'author') 475 475 476 476 .. _overriding-modelform-clean-method: 477 477 … … 514 514 515 515 >>> class RestrictedArticleForm(EnhancedArticleForm): 516 516 ... class Meta(ArticleForm.Meta): 517 ... exclude = ['body']517 ... exclude = ('body',) 518 518 519 519 This adds the extra method from the ``EnhancedArticleForm`` and modifies 520 520 the original ``ArticleForm.Meta`` to remove one field.