[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope3-users
Subject:    [Zope3-Users] Re: Problem with containment and @@absolut_url
From:       Philipp von Weitershausen <philipp () weitershausen ! de>
Date:       2006-05-30 8:35:06
Message-ID: 447C03BA.7090105 () weitershausen ! de
[Download RAW message or body]

Achim Domma wrote:
> 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">

As Mats said, iterate over context/articles/values and you should be
fine. ITerating over just context/articles will only yield the names of
the articles, not the article objects themselves.

>     <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.
> 
> Am I missing something?
> 
> regards,
> Achim

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic