equal
deleted
inserted
replaced
163 return coltype, allownull |
163 return coltype, allownull |
164 |
164 |
165 class UndoException(Exception): |
165 class UndoException(Exception): |
166 """something went wrong during undoing""" |
166 """something went wrong during undoing""" |
167 |
167 |
|
168 def __unicode__(self): |
|
169 """Called by the unicode builtin; should return a Unicode object |
|
170 |
|
171 Type of UndoException message must be `unicode` by design in CubicWeb. |
|
172 |
|
173 .. warning:: |
|
174 This method is not available in python2.5""" |
|
175 assert isinstance(self.message, unicode) |
|
176 return self.message |
168 |
177 |
169 def _undo_check_relation_target(tentity, rdef, role): |
178 def _undo_check_relation_target(tentity, rdef, role): |
170 """check linked entity has not been redirected for this relation""" |
179 """check linked entity has not been redirected for this relation""" |
171 card = rdef.role_cardinality(role) |
180 card = rdef.role_cardinality(role) |
172 if card in '?1' and tentity.related(rdef.rtype, role): |
181 if card in '?1' and tentity.related(rdef.rtype, role): |