butler_ddochi/blog/forms copy.py
icurfer ea11832a53
Some checks failed
Build And Test / build-and-push (push) Failing after 53s
init
2024-12-13 17:12:03 +09:00

15 lines
581 B
Python

from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
# fields = ['title', 'content', 'summary', 'tags', 'image']
fields = ['title', 'content', 'summary', 'tags']
widgets = {
'title': forms.TextInput(attrs={'class': 'form-control'}),
'summary': forms.Textarea(attrs={'class': 'form-control'}),
'content': forms.Textarea(attrs={'class': 'form-control', 'id': 'id_content'}),
'tags': forms.TextInput(attrs={'class': 'form-control'}),
}