mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
And now the same for generic forms
This commit is contained in:
@@ -14,7 +14,7 @@ from django.utils.decorators import method_decorator
|
||||
from django.views import generic
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from versioning import versioning
|
||||
from PyRIGS.views import GenericListView, GenericDetailView
|
||||
from PyRIGS.views import GenericListView, GenericDetailView, GenericUpdateView, GenericCreateView, ModalURLMixin
|
||||
|
||||
|
||||
@method_decorator(csrf_exempt, name='dispatch')
|
||||
@@ -249,16 +249,20 @@ class SupplierDetail(GenericDetailView):
|
||||
return context
|
||||
|
||||
|
||||
class SupplierCreate(generic.CreateView):
|
||||
class SupplierCreate(GenericCreateView, ModalURLMixin):
|
||||
model = models.Supplier
|
||||
form_class = forms.SupplierForm
|
||||
template_name = 'supplier_update.html'
|
||||
|
||||
def get_success_url(self):
|
||||
return self.get_close_url('supplier_update', 'supplier_detail')
|
||||
|
||||
|
||||
class SupplierUpdate(generic.UpdateView):
|
||||
class SupplierUpdate(GenericUpdateView, ModalURLMixin):
|
||||
model = models.Supplier
|
||||
form_class = forms.SupplierForm
|
||||
template_name = 'supplier_update.html'
|
||||
|
||||
def get_success_url(self):
|
||||
return self.get_close_url('supplier_update', 'supplier_detail')
|
||||
|
||||
|
||||
class CableTypeList(generic.ListView):
|
||||
|
||||
Reference in New Issue
Block a user