On 19 November 2012 14:58, Michael Hall <[email protected]> wrote:
> Hi Villas
>
> I like the idea of using a var instead of args but I am still uncertain of
> how I get the ID of the current record I am viewing/editing in smartgrid.
>
>
Here is an example of code I am using where 'auid' represents the id of the
author record:
links = [lambda row: (A(B(T('Edit')), _target = "_blank",
_href = URL(r = request,
c = 'authors',
f = 'edit_author',
vars = dict(auid = str(row[
db.akb_authors.id])))))]
query = ...
fields = [list of fields]
I then call the grid with SQLFORM.grid(query, fields=fields, links=links)
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
--