📜  django 创建视图过滤器选项 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:14.557000             🧑  作者: Mango

代码示例2
class FolderCreate(CreateView):
    template_name = 'Form/folder_create.html'
    form_class = FolderForm

    def get_form_kwargs(self):
        kwargs = super(FolderCreate, self).get_form_kwargs()
        kwargs['user'] = self.request.user
        return kwargs