I didn't succceed to patch load_site.py that way. so I left the load_site as it is and modified the lib/python/OFS/ObjectManager.py instead, so: def _checkId(self, id, allow_dup=0): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars. becomes: def _checkId(self, id, allow_dup=1): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars. which also works. Only drawback now is that the entire contents of directories is deleted when you up^load the updated directory. Oleg Broytmann wrote:
On Fri, 4 Feb 2000, Maarten Slaets wrote:
i'm doing a weekly import of a certain site. i'm using load_site.py but, since its a weekly update, the files i'm importing are already there. the load_site gives me a 'The id %s is invalid - it is already in use.' error ofcourse. can anyone help me to make loadsite overwrite the existing objects?
Patch the load_site.py, wrap every call to manage_add with try/except, and on exception, do manage_edit instead. I'd recomment you to download later version of Zope and use recent load_site.py. You still nwill need to patch it. After testing your patches, please publish it here.
Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Maarten Slaets Web Developer KPNQwest Belgium http://www.fonky.com/vcard/MaartenSlaets/