Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

评论的时候应显示文本域--修复方法 #3

Open
movingheart opened this issue Mar 15, 2019 · 0 comments
Open

评论的时候应显示文本域--修复方法 #3

movingheart opened this issue Mar 15, 2019 · 0 comments

Comments

@movingheart
Copy link

点击添加评论的时候,现在显示的是一行。改动一个地方(comments/forms.py)就可以显示文本域,注意看最后的Textarea:
`from django import forms
from .models import Comment

class CommentForm(forms.Form):
name = forms.CharField(
label='Name',
widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Name'})
)
email = forms.EmailField(
label='Email',
widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Email'})
)
content = forms.CharField(
label='Comment',
widget=forms.Textarea(attrs={'class': 'form-control',
'placeholder': 'Content',
'row': 3})
)
`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant