My bad. Try this:

def render_docs(ids,row):
      span = SPAN()
      for id in ids:
         doc = db.wbdocuments(id)
         if doc:
span.append(A(doc.name,_href=URL('download',args=doc.file)))
      return span

db.wbmaster.documents.represent = render_docs

On Oct 14, 5:35 am, Johann Spies <[email protected]> wrote:
> On 14 October 2011 11:14, Massimo Di Pierro <[email protected]>wrote:
>
> > documents is a list of IDs so you have to turn each one of them into a
> > link. You can try:
>
> > db.wbmaster.documents.represent = lambda value, row: SPAN(*[row.name]+
> > [A(v, _href = URL('download', args = v)) for v in value])
>
> > Hope I make sense.
>
> > Yes, it does, thank you.
>
> But that also did not do the job.  I still got a '69' in stead of a list of
> names.  I have changed that to
>
> db.wbmaster.documents.represent = lambda value, row:
> [A(db.wbdocuments[v].name + ', ', _href = URL('download', args = v)) for v
> in value]
>
> (I am not sure how to use 'SPAN' in this case - or why) and now I get a list
> of links which is what I was looking for.
> But the links are wrong.  When clicked on the first link the URL 
> washttp://localhost:8000/init/wbank/download/6
> where it should have downloaded the record with id=6 from db.wbdocuments.
>
> Now I just get a 404 NOT FOUND.
>
> Regards
> Johann

Reply via email to