Python django.views.generic.DeleteView() Examples
The following are 4
code examples of django.views.generic.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
, or try the search function
.
Example #1
Source File: views.py From django-generic-scaffold with MIT License | 6 votes |
def get_delete_class_view(self): name = '{0}_{1}'.format(self.get_name(), 'DeleteView') options_dict = { 'model': self.model, 'kind': 'delete', 'fields': '__all__', 'get_success_url': lambda x: reverse(self.list_url_name), } if hasattr(self, 'delete_template_name') and self.delete_template_name: options_dict['template_name'] = self.delete_template_name parent_classes_list = [FallbackTemplateMixin] parent_classes_list.extend(self.delete_mixins) parent_classes_list.append(self.delete_view_class) klazz = type(name, tuple(parent_classes_list), options_dict ) klazz.get_context_data = self.get_get_context_data(klazz) return klazz
Example #2
Source File: abstract.py From django-flexible-subscriptions with GNU General Public License v3.0 | 5 votes |
def get_context_data(self, **kwargs): """Overriding get_context_data to add additional context.""" context = super(DeleteView, self).get_context_data(**kwargs) # Provides the base template to extend from context['template_extends'] = self.template_extends return context
Example #3
Source File: tests.py From django-generic-scaffold with MIT License | 5 votes |
def test_views_have_correct_parent_class(self): self.assertEquals(self.list_view.__bases__[-1].__name__, "ListView") self.assertEquals(self.create_view.__bases__[-1].__name__, "CreateView") self.assertEquals(self.update_view.__bases__[-1].__name__, "UpdateView") self.assertEquals(self.delete_view.__bases__[-1].__name__, "DeleteView") self.assertEquals(self.detail_view.__bases__[-1].__name__, "DetailView")
Example #4
Source File: tests.py From django-generic-scaffold with MIT License | 5 votes |
def test_views_have_correct_parent_class(self): self.assertEquals(self.list_view.__bases__[-1].__name__, "ListView") self.assertEquals(self.create_view.__bases__[-1].__name__, "CreateView") self.assertEquals(self.update_view.__bases__[-1].__name__, "UpdateView") self.assertEquals(self.delete_view.__bases__[-1].__name__, "DeleteView") self.assertEquals(self.detail_view.__bases__[-1].__name__, "DetailView")