Python django.views.generic.edit.UpdateView() Examples
The following are 2
code examples of django.views.generic.edit.UpdateView().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.views.generic.edit
, or try the search function
.
Example #1
Source File: CRUD.py From djreservation with GNU General Public License v3.0 | 5 votes |
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
Example #2
Source File: views.py From iguana with Creative Commons Attribution Share Alike 4.0 International | 5 votes |
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']}))