[Zope3-Users] Re: Conflicting configuration actions for protectName
__setitem__
Rob Campbell
rcampbell at pcwi.net
Wed Sep 20 16:52:53 EDT 2006
Ok, that's what I thought. How can I fix the problem? I think I can
create an IFosterSourceContainer interface and have the constraint
there. Then I would have to implement that interface for FosterRecord.
Would that work? Also, is there any other/better way to do it?
--
Rob Campbell
Philipp von Weitershausen wrote:
>
>
> Rob Campbell wrote:
>> Hi Darryl,
>>
>> That is how I had the IFosterRecord interface before, and I got a lot
>> more errors than just __setitem__. I am only getting the __setitem__
>> error now, after changing it to something like:
>>
>> class IFosterRecord(Interface):
>>
>> contains('.IFosterSource')
>>
>> title = TextLine(...)
>>
>> and the implementation is:
>>
>> class FosterRecord(BTreeContainer):
>>
>> implements(IFosterRecord)
>>
>> title = FieldProperty(IFosterRecord['title'])
>>
>> I think the problem is coming from contains().
>
> Yup. contains() adds a __setitem__ method to the interface.
>
More information about the Zope3-users
mailing list