def setValueAndUpdateObject(self, memberName, value, object, container = None):
     """
     Sets the specified value of the specified member and updates the object.
     As a container, specify the object (not proxy object) to which this object is attached with an HAS_A or HAS_MANY relationship.
     """
     info = self._memberDict[memberName]
     newValue = info.interpret(value)
     if PyUtils.safeEqual( newValue, self.__getattribute__(memberName) ) : return
     self.__setattr__(memberName, newValue)
     info.set(object, newValue, container )
 def __repr__(self) :
     """
     Creates a representation of this proxy object. This can be evaluated provided the following includes:
       from App.Proxys.All import *
     """
     outMembers = []
     for member in self._members:
         value = self.__getattribute__(member.name)
         if self._verbose and PyUtils.safeEqual(value, member.default) : continue 
         outMember = repr( member.format(value) )
         if self._verbose: outMember = member.name + " = " + outMember
         outMembers.append( outMember )
     return type(self).__name__ + "(" + ','.join(outMembers) + ")"
Ejemplo n.º 3
0
 def __repr__(self):
     """
     Creates a representation of this proxy object. This can be evaluated provided the following includes:
       from App.Proxys.All import *
     """
     outMembers = []
     for member in self._members:
         value = self.__getattribute__(member.name)
         if self._verbose and PyUtils.safeEqual(value, member.default):
             continue
         outMember = repr(member.format(value))
         if self._verbose: outMember = member.name + " = " + outMember
         outMembers.append(outMember)
     return type(self).__name__ + "(" + ','.join(outMembers) + ")"
Ejemplo n.º 4
0
 def setValueAndUpdateObject(self,
                             memberName,
                             value,
                             object,
                             container=None):
     """
     Sets the specified value of the specified member and updates the object.
     As a container, specify the object (not proxy object) to which this object is attached with an HAS_A or HAS_MANY relationship.
     """
     info = self._memberDict[memberName]
     newValue = info.interpret(value)
     if PyUtils.safeEqual(newValue, self.__getattribute__(memberName)):
         return
     self.__setattr__(memberName, newValue)
     info.set(object, newValue, container)