git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2902 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
werners 2008-09-23 14:02:55 +00:00
parent 447d8c7f6c
commit d44621628a
2 changed files with 22 additions and 2 deletions

View file

@ -189,11 +189,21 @@ class ICategory(Interface):
default=u'',
missing_value=u'',
required=False)
order = schema.Int(
title=_(u'Sortingorder'),
description=_(u'Sortingorder'),
default=0,
required=False)
visible = schema.Bool(
title=_(u'Visible'),
description=_(u'Visible in Menu'),
default=True,
required=False)
products = Attribute(u'The products belonging to this category.')
subcategories = Attribute(u'The sub-categories belonging to this category.')
shops = Attribute(u'The shops providing this category.')
accessories = Attribute(u'Accessories for this category.')
# customers

View file

@ -25,7 +25,7 @@ $Id$
from zope.interface import implements, Interface
from cybertools.commerce.common import RelationSet
from cybertools.commerce.interfaces import IProduct
from cybertools.commerce.interfaces import IProduct, ICategory
class Product(object):
@ -39,3 +39,13 @@ class Product(object):
self.title = title or u'unknown'
self.shops = self.collection(self, 'products')
class Category(object):
implements(ICategory)
collection = RelationSet
def __init__(self, title=None):
self.title = title or u'unknown'
self.shops = self.collection(self, 'categories')