148 self._respath = "" |
148 self._respath = "" |
149 for arg in kwargs.keys(): |
149 for arg in kwargs.keys(): |
150 setattr(self, arg, kwargs.get(arg)) |
150 setattr(self, arg, kwargs.get(arg)) |
151 |
151 |
152 def __getstate__(self): |
152 def __getstate__(self): |
153 state = {} |
153 state = self.__dict__.copy() |
154 if self._parent: state['_parent'] = self._parent |
|
155 if self._order: state['_order'] = self._order |
|
156 if self._children: state['_children'] = self._children |
|
157 if self._respath: state['_respath'] = self._respath |
|
158 return state |
154 return state |
159 |
155 |
160 def __setstate__(self, state): |
156 def __setstate__(self, state): |
161 self._name = state.get('ref','') |
157 self.__dict__.update(state) |
162 self._parent = state.get('_parent',None) |
|
163 self._order = state.get('_order',[]) |
|
164 self._children = state.get('_children',{}) |
|
165 self._respath = state.get('_respath',"") |
|
166 # update the parent link for all the children of this object |
|
167 for child in self._objects(): |
|
168 child._parent = self |
|
169 |
158 |
170 def _set_parent(self, newparent): |
159 def _set_parent(self, newparent): |
171 """ |
160 """ |
172 @param newparent: The new parent object |
161 @param newparent: The new parent object |
173 @return: None |
162 @return: None |