import sys
# Modeling
from Modeling.CustomObject import CustomObject
class ClassB (CustomObject):
"""
ClassBs are objects ...
"""
__implements__ = CustomObject.__implements__
def entityName(self):
"Used by the modelization_tool to link this object to an entity"
return "B" # do not change
def __init__( self,
b1 = '',
):
b1 = self.setB1(b1)
self._toA=None
self._toA1=None
# Attributes
# =================== b1 ==========================
def getB1(self):
"Return the ClassB / b1 attribute value"
if not hasattr(self,'_b1') :
self._b1 = None
return self._b1
def setB1(self,b1):
"Change the ClassB / b1 attribute value"
self.willChange()
self._b1 = b1
def validateB1(self, value):
"Edit this to enforce custom business logic"
if 0: # your custom bizlogic
raise Validation.Exception
return
# Relationships
def getToA(self):
"Return the toA relationship"
return self._toA
def setToA(self,object):
"Set the toA relationship to many"
self.willChange()
self._toA=object
def getToA1(self):
"Return the toA1 relationship"
return self._toA1
def setToA1(self,object):
"Set the toA1 relationship to many"
self.willChange()
self._toA1=object
def inverseForRelationshipKey(self, aKey):
"-"
if aKey=='toA': return 'toB'
else:
return CustomObject.inverseForRelationshipKey.im_func(self, aKey)
|