create views comandas

This commit is contained in:
2024-12-12 10:47:36 -03:00
parent ae5d47fa7c
commit 2f84ca97c3
20 changed files with 158 additions and 10 deletions

View File

@@ -1,6 +1,19 @@
from django.shortcuts import render
from django.shortcuts import render, redirect
from comandas.models import Comanda
# Create your views here.
def comandas(request):
return render(request, 'comandas.html')
comandas = Comanda.objects.all()
return render(request, 'comandas.html', {'comandas': comandas})
def viewComanda(request):
id = request.GET.get('parametro')
comanda_id = int(id)
comanda = Comanda.objects.get(id=comanda_id)
return render(request, 'viewcomanda.html', {'comanda': comanda})