Python django.views.generic.edit 模块,FormMixin() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.views.generic.edit.FormMixin()

项目:newco-legacy    作者:blaze33    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        if hasattr(self, "next"):
            kwargs.update({"next": self.next})
        context = super(ContentUpdateView, self).get_context_data(**kwargs)
        if self.model == Item:
            album = get_album(self.object)
            images = search_images(self.object.name)
            context.update({'img_album': json.dumps(album),
                            'img_search': json.dumps(images)})
        return context


# Can't directly subclass FormMixin because of get_context_data.
# Won't be an issue in 1.5