[Zope] Re: get url for localfs objects

Michael Bleijerveld michael at bleijerveld.nl
Thu Aug 14 21:03:09 EDT 2003


Hi Phil,

That doesn't work.

Michael

----- Original Message ----- 
From: "Philipp von Weitershausen" <philipp at weitershausen.de>
To: <zope at zope.org>
Sent: Thursday, August 14, 2003 4:32 PM
Subject: [Zope] Re: get url for localfs objects


> Paul Winkler wrote:
> >>However when I use the python script getLink I receive the following
error.
> >>What's wrong ?
> >
> >
> > Several things. First, you're mixing tal and DTML. Second, you're not
> > providing a namespace for getLink.
> > Assuming that getLink is a python script that lives somewhere above this
> > template, try this:
> >
> >  <tr tal:repeat="file batch" >
> >        <td><input type="checkbox" name="ids:list" value="id"
> >               tal:attributes="value file/id"></td>
> >        <td><a href="HOME_URL"
> >               tal:attributes="href python:container.getLink(file.id)"
> >               tal:content="file/id">HOME TITLE OR ID</a></td>
> >       <br>
> >  </tr>
> >
> > Note several changes:
> > - I changed "files" to "file" because it's only one at a time.
> > - Everywhere you use id, it must be file/id (in python, file.id).
> > - value="<dtml-var id>" won't work in TAL ;-)
> > - getLink lives somewhere... I'm betting on container.getLink
>
> Note that you should never ever use object.id or object/id. Always use
> the getId() method (in TALES object/getId).
>
> Phil
>
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>





More information about the Zope mailing list