[Product-Developers] Re: Need help fixing broken object

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Dec 11 10:52:48 UTC 2008


Hedley Roos, on 2008-12-09:
>
>>   Module Products.BTreeFolder2.BTreeFolder2, line 335, in has_key
>> AttributeError: 'NoneType' object has no attribute 'has_key'
>> 
>> What can I do?
>
> How about an external method?
>
> def run(self):
>      from BTrees.OOBTree import OOBTree
>      setattr(obj, '_tree' , OOBTree())
>      obj._p_changed = 1
>      return 'done'
>
> That will fix the None _tree variable. You may encounter a few other 
> problems as well. Good luck!

Poi has similar migration code.  See the two classes at the top here:

http://svn.plone.org/svn/collective/Products.Poi/trunk/Products/Poi/migration.py

I did not write that part of the code though, so I don't know details.

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]





More information about the Product-Developers mailing list