[Zope] import error

Michael Long mlong@datalong.com
16 Jun 2003 10:21:01 -0400


Thanks for the suggestion. Using the "try:" method worked. So does this
mean that the code is "run" similar to a macro as opposed to just
dumping the data into the database?

Mike

On Mon, 2003-06-16 at 09:29, Oliver Bleutgen wrote:
> Michael Long wrote:
> > That must be the problem. The Catalog object was created in
> > "manage_afterAdd". How do I work around this issue. You will find the
> > traceback below.
> > 
> > 
> >       * Module ZPublisher.Publish, line 98, in publish
> >       * Module ZPublisher.mapply, line 88, in mapply
> >       * Module ZPublisher.Publish, line 39, in call_object
> >       * Module OFS.ObjectManager, line 530, in manage_importObject
> >       * Module OFS.ObjectManager, line 551, in _importObjectFromFile
> >       * Module OFS.ObjectManager, line 272, in _setObject
> >       * Module OFS.ObjectManager, line 280, in manage_afterAdd
> >       * Module Products.PRealEstate.PRealEstate, line 95, in
> >         manage_afterAdd
> >       * Module Products.PRealEstate.PTools, line 25, in setupCatalog
> >       * Module Products.ZCatalog.ZCatalog, line 53, in
> >         manage_addZCatalog
> >       * Module OFS.ObjectManager, line 244, in _setObject
> >       * Module OFS.ObjectManager, line 77, in checkValidId
> 
> I haven't tried this, but I think this should work.
> Just change the sourcecode of PRealEstate.PRealEstate.manage_afterAdd
> and add something like
> 
> if not 'Catalog' in self.ObjectIds():
> 
> as a condition before the catalog is added there.
> Or a try/except clause ...
> 
> cheers,
> oliver
> 
> 
-- 
Michael Long <mlong@datalong.com>