Hi I am building a fairly simple On-line Shopping Product (I know there some out there already, but please humour me) with a number of ZClasses. Different shop instances will obviously need to be customizeable, for example the properties available for items in a shop might be different from shop to shop. How can I use my generic Shop Product to make a different Product each time I deploy a new shop? I am sort of looking to make a meta-class. Does this make any sense to anyone? Felix.
Hi
I am building a fairly simple On-line Shopping Product (I know there some out there already, but please humour me) with a number of ZClasses. Different shop instances will obviously need to be customizeable, for example the properties available for items in a shop might be different from shop to shop.
How can I use my generic Shop Product to make a different Product each time I deploy a new shop? I am sort of looking to make a meta-class.
Does this make any sense to anyone?
Hi, You can always add properties to instances of a Z Class by calling manage_AddProperty. You could have a folder with prototype instances of your Z Class and copy them when you need an instance, or you could have different edit forms that add properties when needed. Douwe
Felix Ulrich-Oltean writes:
I am building a fairly simple On-line Shopping Product (I know there some out there already, but please humour me) with a number of ZClasses. Different shop instances will obviously need to be customizeable, for example the properties available for items in a shop might be different from shop to shop.
How can I use my generic Shop Product to make a different Product each time I deploy a new shop? I am sort of looking to make a meta-class. When you speak of single shops and not shop classes, then you can add the properties on an instance level, when the shop is instantiated.
When you mean shop classes, where each class is represented by its own ZClass, then it is a bit more difficult. You may want to read a message from me on "zope-dev@zope.org" on abstract ZClass'es. Essentially, derived ZClasses can inherit methods and whole property sheets from their base classes. They can override inherited and define new methods. They can define new property sheets but they cannot change or customize inherited property sheets (e.g. define new default values). Keeping this in mind, you can define a BaseShop class with most of the shop infrastructure. Each shop class can then be implemented by a ZClass deriving from BaseShop. They can use their own property sheets in addition to the inherited ones. Note: it may be easier to do this with a Python based product rather than ZClasses. Dieter
participants (3)
-
Dieter Maurer -
douwe@oberon.nl -
Felix Ulrich-Oltean