Refactored container types list views to new style.
This commit is contained in:
@@ -73,3 +73,20 @@ class ContainerTypeCreateView(generic.CreateView):
|
||||
form.instance.changed_by = self.request.user
|
||||
form.instance.created_by = self.request.user
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
class ContainerTypeUpdateView(generic.UpdateView):
|
||||
model = ContainerType
|
||||
# template_name = 'container/detail.html'
|
||||
fields = ['named_id', 'description', 'width', 'length', 'height', 'inner_width', 'inner_length', 'inner_height',
|
||||
'has_cover', 'contains_container']
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.changed_by = self.request.user
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
class ContainerTypeDeleteView(generic.DetailView):
|
||||
model = ContainerType
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user