Tip: when you are struggling, take something which works and then using
'baby-steps' incrementally change the example until it is transformed into
what you need.
Here is something which you previously said was working:
def view_all_suggestions_and_comments():
query = (db.IdeaComment.ideaID==db.Idea.id) & (db.IdeaComment.partyID==
db.Party.id)
grid = SQLFORM.grid(query, ,links = [dict(header='Virtual Field',
body=lambda row: A('Add a comment!',_class="btn btn-mini",
_href=URL('comment_on_a_suggestion', vars=dict(filter=row.Idea.id))))])
return dict(grid = grid)
Try isolating the links into a new variable mylistoflinks and make it a
list (so you can have multiple links):
def view_all_suggestions_and_comments():
query = (db.IdeaComment.ideaID==db.Idea.id) & (db.IdeaComment.partyID==
db.Party.id)
mylistoflinks = [
dict(header='Virtual Field', body=lambda row: A('Add a
comment!',_class="btn btn-mini", _href=URL('comment_on_a_suggestion',
vars=dict(filter=row.Idea.id)))),
dict(header='Virtual Field', body=lambda row: A('Add a
comment!',_class="btn btn-mini", _href=URL('comment_on_a_suggestion',
vars=dict(filter=row.Idea.id)))),
]
grid = SQLFORM.grid(query, links = mylistoflinks )
return dict(grid = grid)
Hope that works. Good luck with your iterations!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.