18 Jan
2001
18 Jan
'01
11:26 a.m.
Hi guys, I've been tinkling with a function that does what REQUEST.resolve_url does, except without it relying on having a REQUEST instance available. That is, just resolving the path itself, something like this: path ÿstring.split(relative_url, '/') path ÿfilter(None, path) new_path ÿ'%s' % path[0] path ÿpath[1:] for element in path: new_path ÿnew_path + "['%s']" % element return eval("self%s" % new_path) Now, neither []- or .-like evaluation of the path works.. Any ideas? Cheers, Morten