[Zope] Moving the Data.fs

Dylan Reinhardt zope at dylanreinhardt.com
Sun Dec 7 15:53:48 EST 2003


On Sun, 2003-12-07 at 01:57, Jørgen Larsen wrote:
> Hi Dylan,
> 
> I think you need to read the orginal post ;) The refresh method is used
> for opdating the manage_main attribute that had the wrong path when i
> moved the Data.fs file from a Linux to a Windows system.

Ah, clearly I was confused.  

This just shouldn't be a problem and I'm surprised that it is.  I've
never had any trouble moving my products among several different
platforms.  If your paths use forward slashes and relative paths, there
should be no trouble getting DTMLFile to work at all.  

(You should be using DTMLFile instead of HTMLFile, by the way.  HTMLFile
is a potential security risk and is pretty much deprecated.)

Having said that, you probably don't want to do what you're trying to do
anyway.  You probably should maintain manage_main as a *class* attribute
and change as necessary *for the class* rather than per-instance. 
Handling it this way requires nothing more than a refresh of the product
code to update all instances.

But if you *really* want to override manage_main per-instance, do this:

def refresh(self):
    self.manage_main = DTMLFile('foo', globals())
    ^^^^---- this is what you were missing.

HTH,

Dylan




More information about the Zope mailing list