瀏覽代碼

Update 3-tier.py

Now, it can print the product list correctly.
lord63 10 年之前
父節點
當前提交
c7f8f13454
共有 1 個文件被更改,包括 7 次插入2 次删除
  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