- .forms.ModelForm
- .forms.Form
forms.ModelFormクラス
class ArticleForm(ModelForm):
class Meta:
model = Article
fields = ['slug', 'title', 'content',
'category', 'status', 'description']
### 追加 ###
widgets = {
'description': forms.Textarea(attrs={'rows':4, 'cols':15}),
}
forms.Formクラス
class CommentForm(forms.Form):
comment = forms.CharField(widget=forms.Textarea(attrs={'cols': '80', 'rows': '10'}))
widget=forms.Textarea
複数行書き込めるテキストボックス