def update(id): authz.require(authz.watchlist_write(id)) watchlist = obj_or_404(Watchlist.by_id(id)) watchlist.update(request_data()) db.session.add(watchlist) db.session.commit() return view(id)
def delete(id): authz.require(authz.watchlist_write(id)) watchlist = obj_or_404(Watchlist.by_id(id)) analyze_terms.delay(watchlist.terms) watchlist.delete() db.session.commit() return jsonify({'status': 'ok'})
def view(id): authz.require(authz.watchlist_read(id)) watchlist = obj_or_404(Watchlist.by_id(id)) etag_cache_keygen(watchlist) return jsonify(watchlist)