[Zope3-Users] Problem with containment and @@absolut_url

Garanin Michael garanin at m-lan.ru
Mon May 29 15:54:36 EDT 2006


В Пнд, 29/05/2006 в 20:26 +0200, Achim Domma пишет:
> Hi,
> 
> I have implemented ArticleFolder and Article like this:
> 
> 
> class Article(Persistent,Contained):
>      implements(IArticle)
>      title=u''
>      body=u''
> 
> class ArticleFolder(Folder):
>      implements(IArticleFolder)
> 
> 
> Via ZMI I can add, edit and delete articles without problems. I use this 
> TAL statement in a view for the object holding the article folder :
> 
> <p tal:repeat="article context/articles">
>      <a
>         tal:content="article/title"
>         tal:attributes="href article/@@absolute_url">asdf</a>		
> </p>
> 
> This fails with an "There isn't enough context to get URL information." 
> exception. When the exception is thrown, I see in the debugger, that the 
> context of AbsoluteUrl is the id of the first article as unicode string. 
> And this string has of course no __parent__ attribute!?
> 
> I argued that context/articles might return ids, not objects, but in 
> that case article/title should fail also. But if I remove 
> tal:attributes, it works fine.
> 
What is 'articles'? I can think 'articles' is list of dictionarys, like
[ {'title':'bla-bla', ...} , ..., {'title':'bla-bla'}]. 



More information about the Zope3-users mailing list