mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
create views comandas
This commit is contained in:
@@ -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})
|
||||
Reference in New Issue
Block a user