You cannot select a field twice. The DAL does not allow it.

Massimo

On Apr 6, 5:04 pm, Peter Etchells <peter.a.etche...@gmail.com> wrote:
> I am trying to display a field twice in the same row, with two
> different links, along the lines of
>
> View per row:
> ....id(with href to function1)...sameid(with href to function2)...more
> fields from same row
>
> I can't see how to duplicate the id in the controller at the select,
> for example with db(query).select(db.table.id, db.table.id,...) as it
> raises an error (attempt to define object twice)
>
> The best I have got is to implement in the view:
>
> {{extend 'layout.html'}}
>
> {{def link(field, f, arg):}}
> {{return TD(A(field, _href=(URL(r=request, f=f ,args=[arg]))))}}
> {{pass}}
>
> <table>
> {{for row in rows:}}
> {{=TR(link('text1', 'function1', row.id), link('text2', 'function2',
> row.id), TD(row.name))}}
> {{pass}}
> </table>
>
> Any better ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to