from datos import Clientes from datos import Peliculas render = web.template.render('templates') urls = ('/(.*)', 'index') db = web.database( dbn='mysql', db='y36mdrhx01a3r6mx', user='******', pw='rvkzljd0ckntnc3w', host='o61qijqeuqnj9chh.cbetxkdyhwsb.us-east-1.rds.amazonaws.com') Clientes = Clientes() Clientes.read() peliculas = Peliculas() peliculas.read() myform = form.Form( form.Dropdown('Cliente', Clientes.getClientes()), form.Dropdown('Pelicula', peliculas.getPeliculas()), form.Dropdown('Formato', ["Blueray", "DVD"]), form.Dropdown('Tiempo', ["1", "2", "3", "4", "5", "6", "7"])) class index: def GET(self, results): form = myform() registros = db.select('renta') return render.index(form, registros) def POST(self, results):
import web # @ from web import form from datos import Clientes from datos import Peliculas render = web.template.render('templates') urls = ('/(.*)', 'index') db = web.database(dbn='mysql', db='peliculas', user='******', pw='utec') Clientes = Clientes() Clientes.read() Peliculas = Peliculas() Peliculas.read() myform = form.Form(form.Dropdown('Cliente', Clientes.getClientes()), form.Dropdown('Pelicula', Peliculas.getPeliculas()), form.Dropdown('Formato', ["Blueray", "DVD"]), form.Textbox('Tiempo')) class index: def GET(self, results): form = myform() resultado = db.select('peliculas') return render.index(form, resultado) def POST(self, results): form = myform() if not form.validates(): return render.index(form) else:
from datos import Clientes from datos import Peliculas render = web.template.render('templates') urls = ('/(.*)', 'index') db = web.database( dbn='mysql', db='ei61l2qid60lviw9', user='******', pw='qpk282xn6jyssh05', host='o61qijqeuqnj9chh.cbetxkdyhwsb.us-east-1.rds.amazonaws.com') Clientes = Clientes() Clientes.read() Pelis = Peliculas() Pelis.read() myform = form.Form(form.Dropdown('NombreCliente', Clientes.getClientes()), form.Dropdown('Pelicula', Pelis.getPeliculas()), form.Dropdown('Formato', ["BluRay", "DVD", "VHS"]), form.Dropdown('Duracion', ["1", "2", "3", "4"])) class index: def GET(self, results): form = myform() resultado = db.select('renta') return render.index(form, resultado) def POST(self, results): form = myform()