def update_record(self, service_id): data = get_attributes(self) valid, errors = validate_attributes(data) sql_statement = update_sql_statement(data, service_id) record = QueryHandler.execute_query(sql_statement, insert=True) record_audit = QueryHandler.create_audit(self, "Service", data['name_french'], data, "Update Service") return
def update_record(self, org_key): data = get_attributes(self) # raise Exception(self.request) valid, errors = validate_attributes(data) sql_statement = populate_update_statement(data, org_key) record = QueryHandler.execute_query(sql_statement, True) record_audit = QueryHandler.create_audit(self, "Organization", "Organization", data, "Edit Organization") return
def update_record(self): data = get_attributes(self) # raise Exception(data) valid, errors = validate_attributes(data) sql_statement = populate_update_statement(data) record = QueryHandler.execute_query(sql_statement, True) record_audit = QueryHandler.create_audit(self, "Program", "Program", data, "Update Program") return
def save_record(self): data = get_attributes(self) valid, errors = validate_attributes(data) sql_statement = populate_sql_statement(data) record = QueryHandler.execute_query(sql_statement, insert=True) self.redirect("/admin/records/" + data['org_id'] + "?message=Program saved") record_audit = QueryHandler.create_audit(self, "Program", "Program", data, "Create Program") return
def save_record(self): data = get_attributes(self) # raise Exception(data) find_or_create_program(data) check_for_service_duplicate(data) valid, errors = validate_attributes(data) # raise Exception(len(data)) sql_statement = populate_sql_statement(data) # raise Exception(sql_statement) record = QueryHandler.execute_query(sql_statement, insert=True) self.redirect("/admin/records/" + data['org_id'] + "?message=Service saved") record_audit = QueryHandler.create_audit(self, "Service", data['name_french'], data, "Create Service") return
def save_record(self): data = get_attributes(self) valid, errors = validate_attributes(data) if errors: self.redirect("/records/new?message=Please review errors") return if record_exists(data): self.redirect("/records/new?message=Record already exists") return sql_statement = populate_sql_statement(data) record = QueryHandler.execute_query(sql_statement, insert=True) # raise Exception(record) last_record_sql = "SELECT id FROM organization ORDER BY id DESC LIMIT 1;" last = QueryHandler.execute_query(last_record_sql) self.redirect("/records/{0}?message=Saved".format(last[0][0])) record_audit = QueryHandler.create_audit(self, "Organization", data['1_nom'], data, "Create Organization") return