[Zope] Convert URL to object
Phil Harris
phil@wigwamweb.net
Mon, 1 Nov 1999 08:58:29 -0000
Hi Itamar,
Well I have done this with an external method.
Something on the lines of (untested in this form)
def urlToobject(self, url=None):
string.replace(url,'/','.')
return eval(url)
You migh need a bit more than that depending on whether you need to get it
from the root or from a specific dir etc.
But something on these lines should work.
HTH
Phil
phil@WigWamWeb.net
-----Original Message-----
From: itamar@localhost.localdomain
[mailto:itamar@localhost.localdomain]On Behalf Of Itamar Shtull-Trauring
Sent: Monday, November 01, 1999 8:35 AM
To: Rafael Cordones Marcos
Cc: zope@zope.org
Subject: Re: [Zope] Convert URL to object
Rafael Cordones Marcos wrote:
> > I have an attribute Link that contains the URL of an object
> > How to I convert a URL into a reference to an object?
>
> Maybe dereferencing the name?
>
> <dtml-with "_[Link]">
> ...
> </dtml-with>
Nope - that doesn't work.
_______________________________________________
Zope maillist - Zope@zope.org
http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see:
http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org -
http://www.zope.org/mailman/listinfo/zope-dev )