def POST(self): form = self.form() if not form.validates(): return render.visit(form) if model.exist(form.d.Name)==1 and model.existHs(form.d.HouseID): ag=model.get_agencyID(form.d.HouseID) hs=model.get_house(form.d.HouseID) model.new_visit(form.d.Name, form.d.Visit_Date, form.d.HouseID, hs.locationHouse, ag.Agency_idAgency) raise web.seeother('/visit')
def POST(self, name, date): form = Visit.form() client = model.get_visitor(name) if not form.validates(): return render.editvisitor(client, form) if model.exist(form.d.Name)==1: ag=model.get_agencyID(form.d.HouseID) print ag hs=model.get_house(form.d.HouseID) print hs model.del_visitor(name,date) model.new_visit(form.d.Name, form.d.Visit_Date, form.d.HouseID, hs.locationHouse, ag.Agency_idAgency) raise web.seeother('/visit')