def __init__(self, *args, **kwargs):
super(ContactForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
# set form tag attributes
self.helper.action = reverse('contact_admin')
self.helper.form_method = 'POST'
self.helper.form_class = 'form-horizontal contact-form'
# set form field properties
self.helper.help_text_inline = True
self.helper.html5_required = False
self.helper.attrs = {'novalidate': ''}
self.helper.label_class = 'col-sm-2 control-label'
self.helper.field_class = 'col-sm-10'
# add buttons
self.helper.add_input(Submit('send_button', _(u'Submit')))
评论列表
文章目录