コード例 #1
0
ファイル: manage.py プロジェクト: htutuckaet/appsite
def fill_tasks():
    with open('tasks.json') as f:
        mock = json.load(f)
    for i in mock:
        try:
            create_user_task(**i)
        except IntegrityError:
            continue
コード例 #2
0
ファイル: app.py プロジェクト: madpark13/Flask_Simple
def user_page(name):
    if request.method=='POST':
        title = request.form['title']
        details = request.form['details']
        deadline = request.form['deadline']
        try:
            author_id = get_id_by_name(name)
        except AccountNotFound:
            abort(404)
        create_user_task(author_id, title, details, deadline)
    try:
        user_tasks = get_user_tasks(name)
    except AccountNotFound:
        abort(404)
    return render_template('user.html', name=name, tasks=user_tasks)
コード例 #3
0
def fill_tasks():
    with open('MOCK_DATA_TASKS.json') as f:
        mock = json.load(f)
    for i in mock:
        create_user_task(**i)