[Zope-CMF] Re: portal poll: AttributeError

Dave Woolston davew@digicool.com
Mon, 16 Apr 2001 10:46:18 -0400


Hello Andreas,

Andreas Lindenblatt wrote:

> - the properties of the propertysheet with type of int required a value
> (not "", I used '0')
> - while adding the ZClass there's no CMF:PortalContent in the Base
> Classes, I used CMFCore:PortalContent
> 

Thanks - I updated the Tutorial with both those corrections

> Testing the portal poll was not successfull. After I press [Add] at 'Add
> Content' -> Poll -> ID:TestPoll, I get:
> 
> Error Type: AttributeError
> Error Value: PollClassProduct
> 
> --- cut ---
> Traceback (innermost last):
>   File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 223,
> in publish_module
>   File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 187,
> in publish
>   File /usr/share/zope/lib/python/Zope/__init__.py, line 221, in
> zpublisher_exception_hook
>     (Object: Traversable)
>   File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 171,
> in publish
>   File /usr/lib/python1.5/site-packages/ZPublisher/mapply.py, line 160,
> in mapply
>     (Object: invokeFactory)
>   File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 112,
> in call_object
>     (Object: invokeFactory)
>   File /var/zope/Products/CMFCore/PortalFolder.py, line 368, in
> invokeFactory
>     (Object: Traversable)
>   File /var/zope/Products/CMFCore/TypesTool.py, line 714, in
> constructContent
>     (Object: Traversable)
>   File /var/zope/Products/CMFCore/TypesTool.py, line 469, in
> constructInstance
>     (Object: ElementWithAttributes)
>   File /var/zope/Products/CMFCore/TypesTool.py, line 440, in
> _getFactoryMethod
>     (Object: ElementWithAttributes)
>   File /usr/share/zope/lib/python/App/FactoryDispatcher.py, line 99, in
> __getitem__
>   File /usr/share/zope/lib/python/App/FactoryDispatcher.py, line 102, in
> __bobo_traverse__
>   File /usr/share/zope/lib/python/App/Product.py, line 135, in _product
>     (Object: Traversable)
> AttributeError: (see above)
> --- cut ---
> 
> I'm fairly sure I have a fundamental typo somewhere, but I can't figure
> out what's wrong. Before I recheck things for a fourth time... maybe
> someone with more experience has an idea where to look for this
> 'AttributeEror'?

I can't tell exactly where the error is, but Attribute Error means that
the machinery claims that 'PollClassProduct' is an unknown attribute.
...Sure enough, there is a typo in the Tutorial - when you reference your
product through the types tool, it needs to know the product name.  I
have updated the Tutorial, you should just have to change that reference
on the properties tab of the 'poll' type in the portal_types tool.

Thanks for the feedback,
Dave

=================================
Dave Woolston   davew@digicool.com
Digital Creations  www.digicool.com
(716) 262-4715