def new(self, need_load=True, **dict_data):#Return { fn: value } if need_load: yield self.load(need_value=False) _attr = Attribute(self._table) _attrib_id = yield _attr.new(**dict_data) ''' try: _attrib_id = yield _attr.new(**dict_data) except Exception, e: raise AttribManagerException("[ %s ]new failed. table:%s, data: %s, error:%s." % ( self.__class__, self._table, dict_data, e)) ''' if self._multirow: if not isinstance(self.dict_attribs, dict): log.warn('[ %s.new ]property dict_attribs is not dict. %s' % ( self.__class__, self.dict_attribs )) self.dict_attribs = {} self.dict_attribs[_attrib_id] = _attr else: self.dict_attribs = _attr #returnValue( _attr.value ) returnValue( _attr.new_value() )