-1
forms.py__init __()は
class edit_product_data_check(forms.Form):
class Meta:
model = product_data
fields = '_all_'
views.py
def update_product_data(request):
if request.method == "POST":
# Get the posted form
p_id=request.POST.get("product_id", "")
product_edit = get_object_or_404(product_data, id=p_id)
form = edit_product_data_check(request.POST, request.FILES, instance=product_edit)
if form.is_valid():
form.save()
HttpResponseRedirect(reverse('index'))
return HttpResponseRedirect(reverse('product'))`
注意をまた、 '_all_'は' __all__'でなければなりません。 –