Beispiel #1
0
def delete_outhor(author_id):
    if not (author_id):
        return {'status': 'error'}
    print(type(author_id))
    db_session = DBSession()
    outhor = db_session.query(Authors).get(author_id)
    db_session.delete(outhor)
    db_session.commit()
    db_session.close()

    return {'status': 'OK'}
Beispiel #2
0
def delete_book(book_id):
    if not (book_id):
        return {'status': 'error'}

    db_session = DBSession()
    book = db_session.query(Books).get(book_id)
    db_session.delete(book)
    db_session.commit()
    db_session.close()

    return {'status': 'OK'}