Example #1
0
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))
Example #2
0
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))
Example #3
0
def stories_create():
    story = dict(request.json)
    story.pop("_id", None)
    story["cards"] = []
    story["created_at"] = datetime.utcnow()
    story["updated_at"] = datetime.utcnow()
    ret = stories.insert(story)
    extract.delay(unicode(ret))
    return stories_get(ret)
Example #4
0
def stories_create():
    story = dict(request.json)
    story.pop('_id', None)
    story['cards'] = []
    story['created_at'] = datetime.utcnow()
    story['updated_at'] = datetime.utcnow()
    ret = stories.insert(story)
    extract.delay(unicode(ret))
    return stories_get(ret)