basic_display.py 694 B

12345678910111213141516171819202122232425262728
  1. from model.product import Product
  2. from model.ord import Ord
  3. from model.ori import Ori
  4. class BasicDisplay():
  5. def product(self, p):
  6. print(p.id ,':', p.name)
  7. def productList(self, pList):
  8. for pRaw in pList:
  9. p = Product(pRaw)
  10. self.product(p)
  11. def bookOrder(self, b):
  12. print(b.id, ':', b.date)
  13. def bookOrderList(self, bList):
  14. for bRaw in bList:
  15. b = Ord(bRaw)
  16. self.bookOrder(b)
  17. def orderedItem(self, i):
  18. print(i.id, ':', i.quantity, 'g of', i.name, 'dued', i.date)
  19. def orderedItemList(self, iList):
  20. for iRaw in iList:
  21. i = Ori(iRaw)
  22. self.orderedItem(i)