def movie_rank(mid): if request.method == "POST": if query.exists("MOVIES", (mid, )): record = (request.form['rating'], mid) query.update('MOVIES', record) return redirect(url_for('movie_list')) return render_template("movierank.html")
def movie_edit(inf): if request.method == "POST": get = query.getinbyid("movies", (inf, )) record = (str(uuid.uuid4()), get[1], request.form['rating'], get[3]) query.update('movies', record) return redirect(url_for('movie_list')) return render_template("editmovie.html", inf=inf)
def update(self): """Update class to db""" query.update('portfolios', self.id, name=self.name, margin=self.margin, broker=self.broker)
def update(self): """Update class to db""" query.update('shares', self.id, ticker=self.ticker, amount=self.amount, stock=self.stock, currency=self.currency, price=self.price, commission=self.commission)
def update_adv(): id = request.form['id'] content = request.form['content'] header = request.form['header'] price = request.form['price'] region = request.form.get('region') if 'file' in request.files: file = request.files['file'] query.image_save(id, file) query.update(content, header, price, id, region) flash('Tiedot tallennettu', 'success') return redirect('/advertisement/edit/' + str(id))
def movie_rent(mid): query.update("MOVIES", (mid, )) return redirect(url_for('movie_list'))
def update_job(): logger.info("Starting update job") query.update() logger.success("Completed update job")
def save(self, fields): query.update('habits', fields, {'id': self.id})
elif op == 'exit': exit() elif op == 'add': name = input('enter name: ') phone = input('enter phone: ') query.add(db, table_name, name=name, phone=phone) elif op == 'delete': name = input('enter name: ') query.delete(db, table_name, name) elif op == 'view': query.select(db, table_name) elif op == 'edit': var = input('update name or phone: ') if var == 'name': phone = input('enter the phone no of which name to be updated: ') new_name = input('enter the new name: ') query.update(db, table_name, phone=phone, where_name=new_name) if var == 'phone': name = input('enter the name whose number to be updated: ') new_phone = input('enter the new phone no: ') query.update(db, table_name, name=name, where_phone=new_phone) elif op == 'search': att = input('search by name or phone: ') if att == 'name': name = input('enter the name: ') query.search(db, table_name, name=name) if att == 'phone': num = input('enter the phone no: ') query.search(db, table_name, phone=num)