예제 #1
0
 def select(self):
     return session.query(Sessions.id, Sessions.user_id,
                          Sessions.session_id,
                          Sessions.expiration_date).all()[:]
예제 #2
0
        user = Users()
        user.k_number = k_number
        user.name = name
        session.add(user)
        session.commit()

    elif len(value) == 2 and isinstance(value[0], int):
        user_id, book_id = value

        lending = Lending()
        lending.user_id = user_id
        lending.book_id = book_id
        session.add(lending)
        session.commit()

    else:
        print('Error:Invalid argument')
        sys.exit()


if 1 < len(args):
    insert(*args)

print('--------------------')
print(session.query(Books.id, Books.isbn, Books.title, Books.place).all()[:])
print('--------------------')
print(session.query(Users.id, Users.k_number, Users.name).all()[:])
print('--------------------')
print(session.query(Lending.id, Lending.user_id, Lending.book_id).all()[:])
예제 #3
0
 def select(self):
     return session.query(Lending.id, Lending.user_id, Lending.book_id,
                          Lending.date).all()[:]
예제 #4
0
 def delete(self, id_):
     session_ = session.query(Sessions).filter(Sessions.id == id_).first()
     session.delete(session_)
     session.commit()
예제 #5
0
 def select(self):
     return session.query(Users.id, Users.k_number, Users.name).all()[:]
예제 #6
0
 def delete(self, id_):
     lending = session.query(Lending).filter(Lending.id == id_).first()
     session.delete(lending)
     session.commit()
예제 #7
0
 def delete(self, id_):
     user = session.query(Users).filter(Users.id == id_).first()
     session.delete(user)
     session.commit()
예제 #8
0
 def select(self):
     return session.query(Books.id, Books.isbn, Books.title,
                          Books.place).all()[:]
예제 #9
0
 def delete(self, id_):
     book = session.query(Books).filter(Books.id == id_).first()
     session.delete(book)
     session.commit()
예제 #10
0
 def select(self):
     return session.query(Thesis.id, Thesis.identifier,
                          Thesis.title).all()[:]
예제 #11
0
 def delete(self, id_):
     thesis = session.query(Thesis).filter(Thesis.id == id_).first()
     session.delete(thesis)
     session.commit()