[Zope] Setting base_href to another url?

VanL news@lindbergs.org
Sat, 06 Jul 2002 23:13:46 -0600


Hello,

Is it possible, outside of hacking the Zope source, to have the base 
href set to some other string?

For example, have a folder or other object defined with a property, 
'base_href' and have the base set to that.
This would be the servername/port only, not any path afterwords.


I would even hack the zope source, if need be, if someone can tell me 
how I could get to the objects properties as they are set in 
Zpublisher/HTTPResponse.py.  The apparently relevant function,

    def setBase(self,base):
        'Set the base URL for the returned document.'
        if base[-1:] != '/':
            base=base+'/'
        self.base=base

Isn't quite clear how it is getting the servername and port.

All I would need is something like this:
(Sorry, don't know if this is the preferred method or style)

    def setBase(self,base):
        'Set the base URL for the returned document.'
        # Look for a base_href property
        if self.__dict__.has_key('base_href'):
            base[0] = self.base_href
        if base[-1:] != '/':
            base=base+'/'
        self.base=base

Thanks,

VanL