Parcourir la source

Update 3-tier.py

Now, it can print the product list correctly.
lord63 il y a 10 ans
Parent
commit
c7f8f13454
1 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 7 2
      3-tier.py

+ 7 - 2
3-tier.py

@@ -38,8 +38,7 @@ class Ui(object):
     def get_product_list(self):
         print('PRODUCT LIST:')
         for product in self.business_logic.product_list():
-            #print(product)
-            yield product
+            print(product)
         print('')
 
     def get_product_information(self, product):
@@ -66,6 +65,12 @@ if __name__ == '__main__':
     main()
 
 ### OUTPUT ###
+# PRODUCT LIST:
+# (Fetching from Data Store)
+# cheese
+# eggs
+# milk
+# 
 # (Fetching from Data Store)
 # PRODUCT INFORMATION:
 # Name: Cheese, Price: 2.00, Quantity: 10