Python django.views.generic.edit.DeleteView() Examples
The following are 4
code examples of django.views.generic.edit.DeleteView().
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: views.py From mendelmd with BSD 3-Clause "New" or "Revised" License | 5 votes |
def get_context_data(self, **kwargs): context = super(GenesetDetailView, self).get_context_data(**kwargs) return context # class GenesetDeleteView(DeleteView): # def get_object(self, queryset=None): # """ Hook to ensure object is owned by request.user. """ # obj = super(GenesetDeleteView, self).get_object() # if not obj.owner == self.request.user: # raise Http404 # return obj
Example #2
Source File: views.py From mendelmd with BSD 3-Clause "New" or "Revised" License | 5 votes |
def get_context_data(self, **kwargs): context = super(GenesetDetailView, self).get_context_data(**kwargs) return context # class GenesetDeleteView(DeleteView): # def get_object(self, queryset=None): # """ Hook to ensure object is owned by request.user. """ # obj = super(GenesetDeleteView, self).get_object() # if not obj.owner == self.request.user: # raise Http404 # return obj
Example #3
Source File: views.py From mendelmd with BSD 3-Clause "New" or "Revised" License | 5 votes |
def get_context_data(self, **kwargs): context = super(GenesetDetailView, self).get_context_data(**kwargs) return context # class GenesetDeleteView(DeleteView): # def get_object(self, queryset=None): # """ Hook to ensure object is owned by request.user. """ # obj = super(GenesetDeleteView, self).get_object() # if not obj.owner == self.request.user: # raise Http404 # return obj
Example #4
Source File: views.py From zentral with Apache License 2.0 | 5 votes |
def delete(self, request, *args, **kwargs): # TODO we can't just use the DeleteView delete method, but can we do better than that ? self.object = self.get_object() success_url = self.get_success_url() SubManifestAttachment.objects.trash(self.object.sub_manifest, self.object.name) return HttpResponseRedirect(success_url)