[Product-Developers] why is my view not used?

Mikko Ohtamaa mikko+plone at redinnovation.com
Thu Dec 22 14:29:20 UTC 2011


On Thu, Dec 22, 2011 at 11:50 AM, Maarten Nieber <maarten at usecm.com> wrote:
>> tal:content="python:view.blah()"
>>
>
> When I try this, again, it seems its using SimpleViewClass and not my own view
> class.
>
>  Module zope.tales.tales, line 696, in evaluate
>   - URL:
> /home/mnieber/code/cm/elmolino.buildout/src/elmolino.backend/elmolino/backend/br
> owser/instantmessage.pt
>   - Line 17, Column 18
>   - Expression: <PythonExpr (view/blah())>

Read carefully the expression I gave you and what you typed in (both
above). You made a mistake.

Products.Five does some magic for view classes and they all get
aliased as SimpleViewClass... some wizard can probably tell what it is
and why and how you should co-operate with that, but I just know it
happens. So don't care about the class name.

-Mikko


>   - Names:
>      {'args': (),
>       'container': <InstantMessage at /em/howdy>,
>       'context': <InstantMessage at /em/howdy>,
>       'default': <object object at 0xb77f1690>,
>       'here': <InstantMessage at /em/howdy>,
>       'loop': {},
>       'nothing': None,
>       'options': {},
>       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at
> 0xd836464>,
>       'request': <HTTPRequest,
> URL=http://localhost:8080/em/howdy/@@instantmessage_view>,
>       'root': <Application at >,
>       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile
> object at 0xc02a2ac>,
>       'traverse_subpath': [],
>       'user': <PropertiedUser 'admin'>,
>       'view': <Products.Five.metaclass.SimpleViewClass from
> /home/mnieber/code/cm/elmolino.buildout/src/elmolino.backend/elmolino/backend/br
> owser/instantmessage.pt object at 0xda6c44c>,
>       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at
> 0xda97e4c>}
>  Module zope.tales.pythonexpr, line 59, in __call__
>   - __traceback_info__: (view/blah())
>  Module <string>, line 1, in <module>
> NameError: name 'blah' is not defined
>> <string>(1)<module>()
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers



-- 
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000


More information about the Product-Developers mailing list