Hi,

I have the following action in the controller, doing a join to display
"office name" and a reference to department of "department name" to
which office belongs...but i have an error in the link since I have a
modal window am opening to edit/add/delete details...this is the
error:

<type 'exceptions.AttributeError'> 'Row' object has no attribute 'id'


def office():
    db.office.id.readable = False
    query = ((db.office.department == db.department.id))
#((db.contact.date_of_birth < “1990-11-18”))
    fields = (db.office.name, db.department.name)
    link =  [lambda row: A('Edit', _class='btn', _role='button',
_onclick='dept_edit('+str(row.office.id)+');',**{'_data-toggle':'modal'})
,lambda row: A('Delete', _class='btn', _role='button',
_onclick='dept_delete('+str(row.id)+');',**{'_data-toggle':'modal'})]
    headers = {'db.office.name': 'Office Name','db.department.name':
'Department'}
    default_sort_order=[db.office.name]

    form = SQLFORM.grid(query=query, headers=headers,
orderby=default_sort_order ,links=link, create=False, deletable=True,
editable=False, maxtextlength=64, paginate=25)
    return dict(form=form)

How do I pass an id of a row in lambda for the link parameter of the
SQLFORM.grid.

Been stuck with this error for a day now!!

Kind regards,

Teddy L.

-- 



Reply via email to