I really don't understand what I'm doing wrong.
I am trying to create a view in which it will be possible to update information about the model object. I do this using UpdateView and ModelForm.
Here is the form that inherits objects from the model
class UpdateOrderDir(forms.ModelForm):
class Meta:
model = m.OrderStorage
fields = '__all__'
HTML
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Save</button>
</form>
View
class DetailOrderViewDir(UpdateView):
success_url = reverse_lazy('directorOrdersDetail')
template_name = "director/order_detail_dir.html"
form_class = f.UpdateOrderDir
def get_queryset(self):
return m.OrderStorage.objects.filter(pk=self.kwargs['pk'])
URL
path('director/orders/<int:pk>/', v.DetailOrderViewDir.as_view(), name='directorOrdersDetail'),
At the output I get a form.
When I make changes to the Form, the following error occurs, but the data is updated.
So that when submitting the form, the page is updated and the user is on the same page