Exemplo n.º 1
0
def get_or_post(form_id, user_id):
    if request.method == 'POST':
        Answer.update(form_id, user_id, json.loads(request.data))
        return request.data
    else:
        form = Form.from_id(form_id)
        form.update_with_answers(user_id)
        return json.dumps(form.as_dict())