[Zope] Error Value: 'File'
object has no attribute 'manage_fixupOwnershipAfterAdd'
Chris Withers
chris at simplistix.co.uk
Mon Feb 20 14:53:19 EST 2006
Roman Klesel wrote:
> Chris Withers schrieb:
>>> for id in self.manage_targets.keys():
>>> title =
>>> self.manage_targets[id]['name']
>>> self.tgt_folder=Folder()
>>
>> This is dangerous...
>
> Why is that?
'cos arbitarilly assigning objects to attributes without understanding
acquisition of the pseudo-interfaces you need to adhere to in Zope will
mean this _will_ bite you later...
>> Why not just:
>>
>> self.manage_addFolder(id,title)
>
> Well, the suggestion I got was to do:
>
> self.manage_addProduct['OFSP'].manage_addFolder(...
They're the same thing really...
> and this runs in the "Error Value: _getProducts"
> Error.
Yes, because, almost certainly, 'self' above was not acquisition wrapped.
>> Okay, what type of object is 'self' here, where did you take this code
>> from?
>
> I'm proud to say: I wrote this myself. :-)
Well, you did it wrong... show us soem code and we can fix it.
>> system = getattr(self,id)
>>
>> ...but it really depends on what 'self' is, I'm not sure you have that
>> right.
>
> This also works. However to me it looks like, it produces the exact same result as __getitem__ and self[id] ...
_don't_ count on it...
> This "being acquisition wrapped" is driving me nuts!
> I just don't get it.
Then go use PHP ;-)
> And I belive it's the cause for the problems I'm facing ...
Yes, stop fighting the framework ;-)
Take some existing examples and try and adapt them rather than starting
from scratch with everything...
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope
mailing list