ui changes, loan quit with hotkey q if no lineedit in focus
This commit is contained in:
@@ -4,6 +4,7 @@ from src.logic import Database
|
||||
from src.schemas import User
|
||||
from .extendLoan import ExtendLoan
|
||||
from src.utils import stringToDate, Icon
|
||||
from src.utils import debugMessage as dbg
|
||||
|
||||
TABLETOFIELDTRANSLATE = {
|
||||
"Titel": "title",
|
||||
@@ -128,7 +129,7 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
if self.radio_currentlyLoaned.isChecked()
|
||||
else "overdue"
|
||||
)
|
||||
# print(mode)
|
||||
print(mode)
|
||||
if self.userMedia == []:
|
||||
books = self.db.getAllMedia(self.userno)
|
||||
for book in books:
|
||||
@@ -145,12 +146,15 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
continue
|
||||
elif mode == "overdue":
|
||||
# book not returned and todays date is greater than todate
|
||||
if book.returned_date != "":
|
||||
dbg(book=book)
|
||||
if book.returned_date is not None:
|
||||
continue
|
||||
# if todate is greater than current date, continue
|
||||
if todate > QtCore.QDate.currentDate():
|
||||
continue
|
||||
self.addBookToTable(book)
|
||||
|
||||
self.addBookToTable(book)
|
||||
print(book.title)
|
||||
def addBookToTable(self, book):
|
||||
self.UserMediaTable.insertRow(0)
|
||||
# item0 = isbn
|
||||
|
||||
Reference in New Issue
Block a user