Refactored container types list views to new style.

This commit is contained in:
2022-03-17 10:42:20 +01:00
parent 1267e8a587
commit 6e8c2de3df
3 changed files with 83 additions and 9 deletions

View File

@@ -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