def __init__(self):
     self.AllLoanedBooksList = []
     self.AllSubscribersList = []
     allLoanedBooks = LoanedBooksRepository.readJson()
     allSubscribers = SubscribersRepository.readJson()
     for singleLoanedBook in allLoanedBooks:
         loanObject = LoanedBook(singleLoanedBook)
         self.AllLoanedBooksList.append(loanObject)
     for subscriber in allSubscribers:
         subscriberObject = Subscriber(subscriber)
         self.AllSubscribersList.append(subscriberObject)
Esempio n. 2
0
 def __init__(self):
     self.AllBooksList = []
     allBooks = BooksRepository.readJson()
     allLoanedBooks = LoanedBooksRepository.readJson()
     for singleBook in allBooks:
         bookObject = Book(singleBook)
         countLoanedBookOfBook = 0
         for loanedBook in allLoanedBooks:
             loanBookObject = LoanedBook(loanedBook)
             if loanBookObject.Id_book == bookObject.Id and loanBookObject.Returned == False:
                 countLoanedBookOfBook += 1
         if countLoanedBookOfBook != bookObject.BookItems:
             self.AllBooksList.append(bookObject)