The most important thing to do at this point is to define the fields property. You will note that we also assign defaults in this dictionary structure. Here is how the core class might appear:
# sweetscomplete.entity.product
from sweetscomplete.entity.base import Base
class Product(Base) :
fields = dict({
'productKey' : '',
'productPhoto' : '',
'skuNumber' : '',
'category' : '',
'title' : '',
'description' : '',
'price' : 0.00,
'unit' : '',
'costPerUnit' : 0.00,
'unitsOnHand' : 0.00
})
We then add a few useful methods to set and retrieve the unique key, and also the product title:
def getKey(self) :
return self['productKey']
def setKey(self, key...