28 Dec
2001
28 Dec
'01
6:24 p.m.
You can call the restrictedTraverse method on your object. It accepts both forms of path you mentioned. '/test/abc/defg' or ['test','abc','defg'] So: def t(self, path): return self.restrictedTraverse(path) should do what you need without any problem. Em Friday 28 December 2001 15:47, Peter Bengtsson escreveu:
splitted = '/folder/subfolder/obj'.split('/') object = context # or 'self' if this is an external method for id in splitted: object = getattr(object, id)
return object # should return the 'obj' object
-- Sidnei da Silva X3ng Consultoria e Desenvolvimento Ltda. sidnei@x3ng.com.br