Agile育成ブログ
未来を変える喜びを
Django

Django お問い合わせフォーム


Warning: count(): Parameter must be an array or an object that implements Countable in /home/xs638785/agile-software.site/public_html/wp-content/plugins/rich-table-of-content/functions.php on line 490
  • .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

複数行書き込めるテキストボックス

You cannot copy content of this page