forms.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:blogghar 作者: v1k45 项目源码 文件源码
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'
            )
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号