Ticket #14392: 14392.patch

File 14392.patch, 1.1 KB (added by Filip Gruszczyński, 14 years ago)
  • docs/topics/forms/modelforms.txt

     
    387387    class AuthorForm(ModelForm):
    388388        class Meta:
    389389            model = Author
    390             fields = ['name', 'title', 'birth_date']
     390            fields = ('name', 'title', 'birth_date')
    391391            widgets = {
    392392                'name': Textarea(attrs={'cols': 80, 'rows': 20}),
    393393            }
     
    471471    >>> class BookForm(ModelForm):
    472472    ...     class Meta:
    473473    ...         model = Book
    474     ...         fields = ['title', 'author']
     474    ...         fields = ('title', 'author')
    475475
    476476.. _overriding-modelform-clean-method:
    477477
     
    514514
    515515    >>> class RestrictedArticleForm(EnhancedArticleForm):
    516516    ...     class Meta(ArticleForm.Meta):
    517     ...         exclude = ['body']
     517    ...         exclude = ('body',)
    518518
    519519This adds the extra method from the ``EnhancedArticleForm`` and modifies
    520520the original ``ArticleForm.Meta`` to remove one field.
Back to Top