cybertools/commerce/README.txt
helmutm 1ff28acd31 work in progress: shops and products
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2798 fd906abe-77d9-0310-91a1-e0d9ade77398
2008-08-10 09:14:19 +00:00

41 lines
776 B
Text

=================================================
Commerce: Shope, Products, Customers, Orders, ...
=================================================
($Id$)
Shops and Products
==================
Let's start with a Shop:
>>> from cybertools.commerce.base import Shop
>>> shop1 = Shop(u'shop1', u'PC up Ltd')
Now we add products to the shop.
>>> from cybertools.commerce.product import Product
>>> p001 = Product(u'p001', u'Silent Case')
>>> shop1.addProduct(p001)
>>> sorted((name, p.title) for name, p in shop1.products.items())
[(u'p001', u'Silent Case')]
Let's have a look at the product - it should correctly reference the shop
it belongs to.
>>> len(p001.shops)
1
>>> p001.shops.keys()[0]
u'shop1'
Customers
=========
Orders
======