[BlueBream] [Zope-dev] Reg. updating catalog indexes in bluebream

Joshua Immanuel josh at hipro.co.in
Fri Jun 24 09:43:58 EDT 2011


Hello,

On Fri, 2011-06-24 at 13:50 +0200, Christian Klinger wrote:
> So if you create in your add form something like this:
> 
> class MYAddForm(AddForm):
> 
>      def create(self, data):
>           return MyObject(data)
> 
> the catalog stuff is done for you. 

If I override just the 'create' method I get the ForbiddenAttribute for
'add' operation on self.context.add(object) in
zope.formlib.form.AddFormBase.add method. 

Here the 'self.context' is a BTreeContainer whose interface is derived
from IContainer and the ZCML config for that class is marked as 

        <class class="..."
                <implements
                	interface="zope.container.interfaces.IContentContainer"
                	/>
                ...
        </class>
        
If I add the zcml config for that class to allow attribute like this

                ...
                <allow attributes="add" />
                ...

I get AttributeError stating that the object has no attribute 'add'

How do I fix this?

-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/bluebream/attachments/20110624/1a31960f/attachment.bin 


More information about the bluebream mailing list