def unstarred_word(word_id, user_id): word = UserWord.query.get(word_id) user = User.find_by_id(user_id) user.starred_words.remove(word) zeeguu.db.session.commit() print word + " is now *unstarred* for user " + user.name return "OK"
def starred_word(word_id, user_id): word = UserWord.query.get(word_id) user = User.find_by_id(user_id) user.star(word) zeeguu.db.session.commit() return "OK"