I created a form to create a client and another to modify it but the problem is that the modification form does not bring the information of the database.
Bring a basic form without fields with data.
view:
def cliente_update(request, id=None):
queryset = get_object_or_404(Cliente, id=id)
if request.method == 'POST':
form = ClienteForm(request.POST or None, instance=instance)
if form.is_valid():
instance = form.save(commit=False)
instance.save()
# return HttpResponseRedirect(instance.get_absolute_url())
else:
form = ClienteForm()
context = {
"titulo": "Editar informacion del Cliente",
"queryset": queryset,
"form": form,
}
return render(request, "clientes/form.html", context)