2
你好我嘗試子類CommentForm,我不知道如果我做正確。我正在隱藏這些字段,但它們不是以這種方式渲染的。Django的形式子類徵求意見
from django.contrib.comments.forms import CommentForm
from django import forms
from django.utils.translation import ungettext, ugettext_lazy as _
class customCommentForm(CommentForm):
name = forms.CharField(widget=forms.HiddenInput)
email = forms.EmailField(widget=forms.HiddenInput)
url = forms.URLField(widget=forms.HiddenInput)
comment = forms.CharField(label=_('Comment'), widget=forms.Textarea,
max_length=3000)