def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user')
super(BlogForm, self).__init__(*args, **kwargs)
# a little housekeeping
self.fields['is_public'].label = 'Publicly visible'
self.fields['short_description'].widget.attrs['class'] = 'materialize-textarea' # noqa
# making forms crispy
self.helper = FormHelper(self)
self.helper.layout = Layout(
'title', 'tag_line', 'short_description', 'is_public',
StrictButton(
'Create a Blog', type='submit',
css_class='btn blue btn-large right waves-effect waves-light'
)
)
评论列表
文章目录