forked from rc/aircox
work on admin ui
This commit is contained in:
20
aircox/forms.py
Normal file
20
aircox/forms.py
Normal file
@ -0,0 +1,20 @@
|
||||
from django import forms
|
||||
from django.forms import ModelForm
|
||||
|
||||
from .models import Comment
|
||||
|
||||
|
||||
class CommentForm(ModelForm):
|
||||
nickname = forms.CharField()
|
||||
email = forms.EmailField(required=False)
|
||||
content = forms.CharField(widget=forms.Textarea())
|
||||
|
||||
nickname.widget.attrs.update({'class': 'input'})
|
||||
email.widget.attrs.update({'class': 'input'})
|
||||
content.widget.attrs.update({'class': 'textarea'})
|
||||
|
||||
class Meta:
|
||||
model = Comment
|
||||
fields = ['nickname', 'email', 'content']
|
||||
|
||||
|
Reference in New Issue
Block a user