Hi

I'm using the following to generate custom links for my SQLFORM.smartgrid:

    actions = dict()
    nextActions = db(db.requisitionStatus.nextFunctionLabel>0).select()
    for nextAction in nextActions:
actions[nextAction.requisitionStatusId] = dict(label=nextAction.nextFunctionLabel, action=nextAction.nextFunction)
    links = [lambda row: A(actions[row.requisitionStatusId]['label'],
_href=URL(actions[row.requisitionStatusId]['action'],args=[row.id]))]

This is all working fine to generate the buttons I need. My problem is that for some of my requisitionStatus records I don't want any button at all to appear for that row. I can't figure out how to do it. I've tried:

    links = [lambda row: A(actions[row.requisitionStatusId]['label'],
_href=URL(actions[row.requisitionStatusId]['action'],args=[row.id])) if actions[row.requisitionStatusId]['label'] != '' else None]

but that just generates a button with the text of 'None'. I'm not that good with lambda functions and was wondering if there was a way that I could have no button generated somehow.

    -Jim

Reply via email to