Spaces:
Runtime error
Runtime error
File size: 616 Bytes
36f1030 47ab257 36f1030 47ab257 36f1030 47ab257 36f1030 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from django import forms
from .models import Post, Comment
class PostForm(forms.ModelForm):
body = forms.CharField(
label='',
widget=forms.Textarea(
attrs={'rows': '3',
'placeholder': 'Say Something...'}
))
class Meta:
model = Post
fields = ['body']
class CommentForm(forms.ModelForm):
comment = forms.CharField(
label='',
widget=forms.Textarea(
attrs={'rows': '3',
'placeholder': 'Say Something...'}
))
class Meta:
model = Comment
fields = ['comment']
|