feat: remplazando formulario compra manual por formulario django

This commit is contained in:
2024-07-06 09:26:26 -05:00
parent 619fa0fcf9
commit 32b5a6ec36
4 changed files with 10 additions and 62 deletions

View File

@@ -11,15 +11,7 @@ import io
def index(request):
return render(request, 'don_confiao/index.html')
def buy(request):
context = {}
if request.POST:
raise Exception(request.POST)
return render(
request, 'don_confiao/purchase.html', context)
def django_buy(request):
if request.method == "POST":
sale_form = PurchaseForm(request.POST)
sale_linea_form = LineaFormSet(request.POST)
@@ -33,7 +25,7 @@ def django_buy(request):
sale_linea_form = LineaFormSet()
return render(
request,
'don_confiao/django_purchase.html',
'don_confiao/purchase.html',
{
'sale_form': sale_form,
'linea_formset': sale_linea_form