示例#1
0
print "save : {}".format(brand.Save())
print "list : {}".format(brand.GetAllBrands())

print "\n\n"

####################################
########### category.py ############
####################################

print "testing category"

category = Category()
category.parent = ""
category.name = "zapatos"

print "save : {}".format(category.Save())
print "list : {}".format(category.GetAllCategories())

print "\n\n"

####################################
########### product.py #############
####################################

product = Product()

product.name = "nuevo producto"
product.description = "a product description"
product.sku = "123"
product.brand = "a brand"
product.color = "red"
示例#2
0
            ,category_id = %(category_id)s 
            ,price = %(price)s 
            ,upc = %(upc)s
            ,color = %(color)s
            ,sell_price = %(sell_price)s
            ,which_size = %(which_size)s
            ,promotion_price = %(promotion_price)s
            ,bulk_price = %(bulk_price)s
            ,position = %(position)s
            ,sold = %(sold)s
            ,added = %(added)s
            ,delivery = %(delivery)s where sku = %(sku)s and deleted = %(deleted)s returning id'''

            category = Category()
            category.name = self.category
            res = category.Save()

            if "error" in res:
                return self.ShowError("Category can not be saved {}".format(res["error"]))

            p = {
                "name": self.name,
                "description": self.description,
                "brand": self.brand,
                "manufacturer": self.manufacturer,
                "color": self.color,
                "material": self.material,
                "bullet_1": self.bullet_1,
                "bullet_2": self.bullet_2,
                "bullet_3": self.bullet_3,
                "image": self.image,