[Zope-CMF] Cannot find default view for CMF object...
Eugene von Niederhausern
evonnied@l4sb.com
31 May 2002 21:26:53 -0500
Is your category class derived from PortalContent or another CMF Content
class? I created something similar to this---a multi-page article. Where
I have the article based on PortalContent,DefaultDublinCoreImpl and then
pages (based on Document) contained with in the article. I am not sure
if I did it right (it works though see http://www.l4sb.com). I defined
and fti for the article pages that defined a view action and I put this
method in the article page (found it somewhere):
def __call__(self):
""" default view """
view = self.restrictedTraverse('portalarticle_view')
if getattr(aq_base(view),'isDocTemp',0):
return apply(view,(self,self.REQUEST))
else:
return view()
I can send you code I have for the multi-page article if you want it.
regards,
Eugene
On Fri, 2002-05-31 at 19:29, Jeff Ross wrote:
> I'm creating two CMF products, both of which derive from PortalFolder. The
> first object is a Store object. The second is a Category object.
>
> Store objects contain category objects. When I view store objects,
> everything is fine. I can also add category objects into my Store object
> easily enough.
>
> However, when I try to view a category object inside of a store object, I
> get the following error message:
>
> Error Type: Not Found
> Error Value: Cannot find default view for "/bws/myStore/alumni"
> ...
> File C:\Program Files\Zope\lib\python\Products\CMFCore\utils.py, line 119,
> in _getViewFor
> (Object: alumni)
>
> I looked at the code for _getViewFor and the error occurs because the
> factory type information for the class cannot be found. I don't understand
> this, because if I create a category outside the Store object, I can view it
> fine.
>
> Any ideas?
>
> Thanks,
>
> Jeff Ross
>
>
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests