Esempio n. 1
0
    def search_history(self, keyword: str):
        user_query = self.__search_user(keyword)
        book_query = self.__search_book(keyword)

        return DatabaseManager.get_list(BookCirculation.select().where(
            (BookCirculation.user << user_query)
            | (BookCirculation.book << book_query)))
Esempio n. 2
0
    def search_borrowing(self, keyword: str):
        user_query = self.__search_user(keyword)
        book_query = self.__search_book(keyword)

        return DatabaseManager.get_list(BookCirculation.select().where(
            ((BookCirculation.user << user_query)
             | (BookCirculation.book << book_query))
            & BookCirculation.return_time.is_null(True)))
 def get_all_books(self):
     return DatabaseManager.get_list(
         Book.select().where(Book.is_available == True))
 def __init__(self):
     DatabaseManager.__init__(self)
     Book.create_table()
 def search(self, keyword):
     return DatabaseManager.get_list(
         Book.select().where((Book.title.contains(keyword))
                             & (Book.is_available == True)))
Esempio n. 6
0
 def get_complete_history(self):
     return DatabaseManager.get_list(BookCirculation.select())
Esempio n. 7
0
 def get_all_being_borrowed(self):
     return DatabaseManager.get_list(BookCirculation.select().where(
         BookCirculation.return_time.is_null(True)))
Esempio n. 8
0
from Manager.DatabaseManager import DatabaseManager
from app import db
db_manager = DatabaseManager(db)
db_manager.add_interval(interval="15:25 - 17:00")
Esempio n. 9
0
 def __init__(self):
     DatabaseManager.__init__(self)
     BookCirculation.create_table()
Esempio n. 10
0
 def get_all_user(self):
     return DatabaseManager.get_list(
         User.select().where(User.is_active == True))
Esempio n. 11
0
 def search(self, keyword):
     return DatabaseManager.get_list(
         User.select().where((User.name.contains(keyword))
                             & (User.is_active == True)))
Esempio n. 12
0
from flask.blueprints import Blueprint
from flask import render_template
from flask import request
from Models.Subject import Subject
from Models.Interval import Interval
from Models.Group import Group
from Models.Lecturer import Lecturer
from Models.Schedule import Schedule
from Manager.DatabaseManager import DatabaseManager
from Routes.addlecturers import Lecturer
from extensions import db
import sqlalchemy.connectors
db_manager = DatabaseManager(db)
add_rasp = Blueprint('addrasp',
                     __name__,
                     template_folder='templates',
                     static_folder='static')


@add_rasp.route('/addrasp')
def index():
    return render_template('addrasp.html',
                           lecturers=Lecturer.query.all(),
                           intervals=Interval.query.all(),
                           groups=Group.query.all(),
                           subjects=Subject.query.all())


@add_rasp.route('/addrasp', methods=['post', 'get'])
def add():
    if request.method == 'POST':
Esempio n. 13
0
from Manager.DatabaseManager import DatabaseManager
from app import db
db_manager = DatabaseManager(db)
db_manager.add_subject(subjects='РиСПСиИТ')
Esempio n. 14
0
from Manager.DatabaseManager import DatabaseManager
from app import db
db_manager = DatabaseManager(db)
db_manager.add_group(groups='БФИ1801')