本文整理汇总了Python中models.Product.width方法的典型用法代码示例。如果您正苦于以下问题:Python Product.width方法的具体用法?Python Product.width怎么用?Python Product.width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Product
的用法示例。
在下文中一共展示了Product.width方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SaveChanges
# 需要导入模块: from models import Product [as 别名]
# 或者: from models.Product import width [as 别名]
def SaveChanges(self):
for row in self.change_rows.keys():
row = int(row)
product = Product()
product.category = models.ALL_PRODUCT_TYPE[self.m_grid5.GetCellValue(row, 0)]
product.type = self.m_grid5.GetCellValue(row, 1)
product.length = self.m_grid5.GetCellValue(row, 2)
product.width = self.m_grid5.GetCellValue(row, 3)
product.height = self.m_grid5.GetCellValue(row, 4)
product.per_weight = self.m_grid5.GetCellValue(row, 5)
product.price = self.m_grid5.GetCellValue(row, 6)
db.UpdateProduct(product)
for new_row in self.new_products.keys():
product = Product()
product.category = models.ALL_PRODUCT_TYPE[self.m_grid5.GetCellValue(row, 0)]
product.type = self.m_grid5.GetCellValue(new_row, 1)
product.length = self.m_grid5.GetCellValue(new_row, 2)
product.width = self.m_grid5.GetCellValue(new_row, 3)
product.height = self.m_grid5.GetCellValue(new_row, 4)
product.per_weight = self.m_grid5.GetCellValue(new_row, 5)
product.price = self.m_grid5.GetCellValue(new_row, 6)
db.InsertProduct(product)
示例2: GetAllProducts
# 需要导入模块: from models import Product [as 别名]
# 或者: from models.Product import width [as 别名]
def GetAllProducts():
"""获取所有的产品数据"""
db_cur = db_conn.cursor()
db_cur.execute(SQL_ALL_PRODUCT)
all_products = {}
for category in models.ALL_PRODUCT_TYPE.values():
all_products[category] = {}
for row in db_cur:
rec = Product()
rec.category = str(row[0])
rec.type = row[1]
rec.length = str(row[2])
rec.width = str(row[3])
rec.height = str(row[4])
rec.per_weight = str(row[5])
rec.price = str(row[6])
all_products[rec.category][rec.type] = rec
return all_products