add IAddress (from cybertools.organize) with additional fields
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2949 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
8c9326149e
commit
a37c582dea
2 changed files with 27 additions and 2 deletions
|
@ -25,7 +25,7 @@ $Id$
|
||||||
from zope.interface import implements, Interface
|
from zope.interface import implements, Interface
|
||||||
|
|
||||||
from cybertools.commerce.common import RelationSet
|
from cybertools.commerce.common import RelationSet
|
||||||
from cybertools.commerce.interfaces import ICustomer
|
from cybertools.commerce.interfaces import ICustomer, IAddress
|
||||||
|
|
||||||
|
|
||||||
class Customer(object):
|
class Customer(object):
|
||||||
|
@ -39,3 +39,9 @@ class Customer(object):
|
||||||
self.title = title or u'unknown'
|
self.title = title or u'unknown'
|
||||||
self.client = client
|
self.client = client
|
||||||
self.shops = self.collection(self, 'customers')
|
self.shops = self.collection(self, 'customers')
|
||||||
|
|
||||||
|
|
||||||
|
class Address(object):
|
||||||
|
|
||||||
|
implements(IAddress)
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@ from zope import schema
|
||||||
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
|
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
|
||||||
from zope.interface import Interface, Attribute
|
from zope.interface import Interface, Attribute
|
||||||
from zope.i18nmessageid import MessageFactory
|
from zope.i18nmessageid import MessageFactory
|
||||||
from loops import util
|
|
||||||
from cybertools.util.jeep import Jeep, Term
|
from cybertools.util.jeep import Jeep, Term
|
||||||
|
from cybertools.organize.interfaces import IAddress
|
||||||
from loops import util
|
from loops import util
|
||||||
|
|
||||||
_ = MessageFactory('cybertools.commerce')
|
_ = MessageFactory('cybertools.commerce')
|
||||||
|
@ -237,6 +238,24 @@ class ICustomer(Interface):
|
||||||
client = Attribute(u'An optional (real) client object of the customer role.')
|
client = Attribute(u'An optional (real) client object of the customer role.')
|
||||||
|
|
||||||
|
|
||||||
|
addressTypesVoc = util.KeywordVocabulary((
|
||||||
|
('standard', _(u'Standard Address')),
|
||||||
|
('invoice', _(u'Invoice Address')),
|
||||||
|
('shipping', _(u'Shipping Address')),
|
||||||
|
('defaultShipping', _(u'Default Shipping Address')),
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
class IAddress(IAddress):
|
||||||
|
|
||||||
|
addressType = schema.Choice(
|
||||||
|
title=_(u'Address Type'),
|
||||||
|
description=_(u'Address type.'),
|
||||||
|
source=addressTypesVoc,
|
||||||
|
default='standard',
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
|
||||||
# orders
|
# orders
|
||||||
|
|
||||||
class IOrder(Interface):
|
class IOrder(Interface):
|
||||||
|
|
Loading…
Add table
Reference in a new issue