def stories_update(id): story = get_story(id) data = dict(request.json) data.pop("_id", None) data.pop("cards", None) story["updated_at"] = datetime.utcnow() stories.update({"_id": story["_id"]}, {"$set": data}) extract.delay(id) return jsonify(get_story(id))
def cards_index(story_id): story = get_story(story_id) cur = cards.find({"stories": story["_id"]}) cur = cur.sort("offset", ASCENDING) cards_ = [] for card in cur: card["evidences"] = get_evidences(card) cards_.append(card) return jsonify(cards_)
def cards_index(story_id): story = get_story(story_id) cur = cards.find({'stories': story['_id']}) cur = cur.sort('offset', ASCENDING) cards_ = [] for card in cur: card['evidences'] = get_evidences(card) cards_.append(card) return jsonify(cards_)
def stories_update(id): story = get_story(id) data = dict(request.json) data.pop('_id', None) data.pop('cards', None) story['updated_at'] = datetime.utcnow() stories.update({'_id': story['_id']}, {'$set': data}) extract.delay(id) return jsonify(get_story(id))
def cards_get(story_id, card_id): story = get_story(story_id) card = get_card(story, card_id) card["evidences"] = get_evidences(card) return jsonify(card)
def stories_get(id): return jsonify(get_story(id))
def stories_index(): cur = stories.find({"$where": "this.title.length > 1"}) return jsonify(cur)
def reset(): reset_db() return jsonify({"status": "ok", "message": "Nuked all the things"})
def cards_get(story_id, card_id): story = get_story(story_id) card = get_card(story, card_id) card['evidences'] = get_evidences(card) return jsonify(card)
def stories_index(): cur = stories.find({'$where': 'this.title.length > 1'}) return jsonify(cur)
def reset(): reset_db() return jsonify({'status': 'ok', 'message': 'Nuked all the things'})