def update_product(prid, name, stock, warning, price): api.edit('product', {'prid': prid}, { 'name': name, 'stock': stock, 'warning': warning, 'price': price })
def email(self, email): api.edit('user', { 'usid': self.usid, 'email': email })
def lastname(self, lastname): api.edit('user', { 'usid': self.usid, 'lastname': lastname })
def firstname(self, firstname): api.edit('user', { 'usid': self.usid, 'firstname': firstname })
def revert_purchase(puid): purchase = get_purchase(puid)[puid] api.edit('product', {'prid': purchase['prid']}, { 'stock': get_product(purchase['prid'])[purchase['prid']]['stock'] + 1 }) delete_purchase(puid)
def authorize_user(usid, level): api.edit('user', { 'usid': usid, 'level': level })
def update_attribute(self, key, value): api.edit('user', { 'usid': self.usid, key: value })
def avatar(self, avatar): api.edit('user', { 'usid': self.usid, 'avatar': avatar })
def root_api_edit(table): content = core.edit(table, request.form) return jsonify(content), 200 if content['success'] else 406