def save_boards(title, user_id, is_active): dbhandler.query_modify( 'INSERT INTO boards (title, is_active, user_id) VALUES (%(title)s, %(isactive)s, %(userid)s);', variables={ 'title': title, 'isactive': is_active, 'userid': user_id })
def registration(): if request.method == 'POST': username = request.form['username'] password = pwhash.hash_password(request.form['password']) dbhandler.query_modify( 'INSERT INTO users (user_name, password) VALUES (%s, %s)', (username, password)) return redirect('/') return render_template('register.html')
def save_cards(title, board_id, status_id, order_id): dbhandler.query_modify( 'INSERT INTO cards (title, board_id, status_id, order_id) VALUES (%(title)s, %(board)s, %(status)s, %(order)s);', variables={ 'title': title, 'board': board_id, 'status': status_id, 'order': order_id })
def delete_boards(board_id): dbhandler.query_modify('''DELETE FROM cards WHERE board_id=%(board_id)s; DELETE FROM boards WHERE id=%(board_id)s;''', variables={'board_id': board_id})
def delete_card(id_): dbhandler.query_modify('DELETE FROM cards WHERE id=%(id)s;', variables={'id': id_})
def clear_cards(): dbhandler.query_modify( 'DELETE FROM cards; ALTER SEQUENCE cards_id_seq RESTART WITH 1;')