[Zope] adding product-based objects programmatically

Kees de Brabander cj.de.brabander at hccnet.nl
Thu Aug 3 10:25:13 EDT 2006


Huh? I included the relevant portions of my source code in my message:

Module QuerySet.py:
from Query import manage_addQuery
class QuerySet(Folder):
    def __init__(self, id, title):
        self.id = id
        self.title = title
        self.manage_addUserFolder()

    def manage_afterAdd(self, item, container):
        manage_addQuery(self, id, title)

manage_addQuery in Query.py looks like:
def manage_addQuery(dispatcher, id, title, REQUEST=None):
    "...."
    nQ=Query(id,title)
    dispatcher.Destination()._setObject(id, nQ)
    if REQUEST is not None:
        dispatcher.manage_main(dispatcher, REQUEST)

cb
----- Original Message ----- 
From: "Jens Vagelpohl" <jens at dataflake.org>
To: "[Zope] Mailing List" <zope at zope.org>
Sent: Thursday, August 03, 2006 3:05 PM
Subject: Re: [Zope] adding product-based objects programmatically


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > Your remark appeared (and presumably is) valid, although I do not  
> > understand
> > why adding acl_user folders has no problems with that. So, I  
> > additionally
> > defined manage_afterAdd. However I got the same error. Any more  
> > pointers? By
> > the way, where are 'manage_afterAdd' and friends documented?
> 
> Google? The source code? Dunno.
> 
> >   a.. Module ZPublisher.Publish, line 101, in publish
> >   b.. Module ZPublisher.mapply, line 88, in mapply
> >   c.. Module ZPublisher.Publish, line 39, in call_object
> >   d.. Module Products.QuerySet.QuerySet, line 81, in  
> > manage_addQuerySet
> >   e.. Module OFS.ObjectManager, line 276, in _setObject
> >   f.. Module Products.QuerySet.QuerySet, line 114, in manage_afterAdd
> >   g.. Module Products.Query.Query, line 80, in manage_addQuery
> > AttributeError: Destination
> 
> This error is obviously coming from your own source code, and since I  
> don't see that code I can't help.
> 
> jens
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
> 
> iD8DBQFE0fSzRAx5nvEhZLIRAoYGAJ9Ic5o/B0SQoe0k459Lre37f0qwVQCdGXhV
> R9oDTi32WNJNhrIYUidfBSI=
> =diJA
> -----END PGP SIGNATURE-----
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


More information about the Zope mailing list