def select(self): return session.query(Sessions.id, Sessions.user_id, Sessions.session_id, Sessions.expiration_date).all()[:]
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()[:])
def select(self): return session.query(Lending.id, Lending.user_id, Lending.book_id, Lending.date).all()[:]
def delete(self, id_): session_ = session.query(Sessions).filter(Sessions.id == id_).first() session.delete(session_) session.commit()
def select(self): return session.query(Users.id, Users.k_number, Users.name).all()[:]
def delete(self, id_): lending = session.query(Lending).filter(Lending.id == id_).first() session.delete(lending) session.commit()
def delete(self, id_): user = session.query(Users).filter(Users.id == id_).first() session.delete(user) session.commit()
def select(self): return session.query(Books.id, Books.isbn, Books.title, Books.place).all()[:]
def delete(self, id_): book = session.query(Books).filter(Books.id == id_).first() session.delete(book) session.commit()
def select(self): return session.query(Thesis.id, Thesis.identifier, Thesis.title).all()[:]
def delete(self, id_): thesis = session.query(Thesis).filter(Thesis.id == id_).first() session.delete(thesis) session.commit()