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