fixed issue 826, callable editable in grid, thanks Douglas

This commit is contained in:
Massimo DiPierro
2012-06-02 14:47:43 -05:00
parent fc7c6d5697
commit 4e7c1ae48a
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
Version 2.00.0 (2012-06-02 14:45:50) dev
Version 2.00.0 (2012-06-02 14:47:41) dev

View File

@@ -1598,7 +1598,7 @@ class SQLFORM(FORM):
def buttons(edit=False,view=False,record=None):
buttons = DIV(gridbutton('buttonback', 'Back', referrer),
_class='form_header row_buttons %(header)s %(cornertop)s' % ui)
if edit:
if edit and (not callable(edit) or edit(record)):
args = ['edit',table._tablename,request.args[-1]]
buttons.append(gridbutton('buttonedit', 'Edit',
url(args=args)))