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

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

项目:bcsmssa    作者:CodeTheChangeUBC    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context['edit_header'] = "Edit Client"
        return context 

# Abuse Update view
项目:bcsmssa    作者:CodeTheChangeUBC    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context['edit_header'] = "Edit Abuse"
        return context 

# Situation Update view
项目:bcsmssa    作者:CodeTheChangeUBC    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context['edit_header'] = "Edit Current Situation"
        return context 

# Service Update view
项目:bcsmssa    作者:CodeTheChangeUBC    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context['edit_header'] = "Edit Requested Services"
        return context 

# Abuse Update view
项目:bcsmssa    作者:CodeTheChangeUBC    | 项目源码 | 文件源码
def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context['edit_header'] = "Edit Referral"
        return context 

# User profile page
项目:djreservation    作者:luisza    | 项目源码 | 文件源码
def get_edit_view_class(self):
        class UUpdateView(UpdateView):

            def form_valid(self, form):
                self.object = form.save(commit=False)
                self.object.user = self.request.user
                self.object.save()
                return HttpResponseRedirect(self.get_success_url())
        return UUpdateView
项目:iguana    作者:iguana-project    | 项目源码 | 文件源码
def post(self, request, *args, **kwargs):
        if 'save_timelog_change' in request.POST:
            return super(UpdateView, self).post(self, request, args, kwargs)
        # direct to delete-template
        return HttpResponseRedirect(reverse('issue:logdelete', kwargs={'project': self.kwargs['project'],
                                    'sqn_i': self.kwargs['sqn_i'], 'sqn_l': self.kwargs['sqn_l']}))