[Zope-CMF] CMFBoringContent.py

Norman Khine khine@btinternet.com
Sun, 5 Aug 2001 22:52:10 +0100


Hi Tres,
Which other usage of it, and in which file?
The only other usage is in the CMFBoringContent.py on line 39

def addCMFBoringContent(self, id, REQUEST=None):
    """Create an empty CMFBoringContent"""
    test_object = CMFBoringContent(id)
    self._setObject(id, test_object)
    afterCreate(self.this()._getOb(id))

Are those the lines?

Thanks

Norman

-----Original Message-----
From: Tres Seaver [mailto:tseaver@palladion.com]
Sent: 05 August 2001 21:46
To: Norman Khine
Cc: Zope-CMF
Subject: Re: [Zope-CMF] CMFBoringContent.py


Norman Khine wrote:

> Hi,
> trying to follow the CMFBoringContent how-to, I am obstructed by the
> following error when I restart the server.
>
> 2001-08-05T16:45:17 ERROR(200) Zope Could not import
> Products.CMFBoringProduct
> Traceback (innermost last):
>   File /usr/home/dsuk5/zope/2.4.0/lib/python/OFS/Application.py, line 552,
> in import_product
>   File
>
/usr/home/dsuk5/zope/2.4.0/lib/python/Products/CMFBoringProduct/__init__.py,
> line 8, in ?
>   File
>
/usr/home/dsuk5/zope/2.4.0/lib/python/Products/CMFBoringProduct/CMFBoringCon
> tent.py, line 10, in ?
>     (Object: os)
> ImportError: cannot import name afterCreate
>
> Now looking at the line 10 for CMFBoringContent.py we have:
>
> from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
>
> removing ', afterCreate' the from CMFBoringContent.py loads the product
> correctly, BUT when I try to add CMFBoringContent from the CMF I get the
> following error:
>
> Error Type: NameError
> Error Value: global name 'afterCreate' is not defined
>
> how is afterCreate defined correctly and where does it reside?


Ouch!  I sent a note Friday that we had just ripped out that API,

because it wasn't doing anything useful.  Delete the other usage
of it (in 'CMFBoringProduct.addBoring...') and everything will be
fine.


Tres.
--
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com