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

Joshua Immanuel <[email protected]>
Newsgroups gmane.comp.web.zope.bluebream,gmane.comp.web.zope.devel
Organization HiPro IT Solutions Private Limited
Message-ID <1308923038.2656.31.camel@jimman>
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
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAk4ElJEACgkQWw85XwuSFMIMSwCeKcwy4kLde3Rqp/Q6nXPN8D4A
SOoAnRk4pufoMvS1GcZJ40oIa3PE62Sx
=ylGc
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.