db.define_table('blob_test',
Field('blob_field', 'blob', readable=True,
represent=lambda value, row: A('link', _href=URL('handler', args=[row.id]))
)
)
#and in the controller:
def blob_grid():
response.view = 'generic.html'
grid = SQLFORM.grid(db.blob_test.id > 0)
return dict(grid=grid)
The result is that the controller does not display the link, and indeed the entire column is overtaken by the default view/edit/delete buttons provided by grid.
Interestingly, the appadmin display of the table does have the represent link as intended.
How can I have this representation work for SQLFORM.grid? Thanks.
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/1bO8XUIo0eU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Traceback (most recent call last
):I think I'll just wait until the next stable release is done.
File "/home/veda/acre/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File "<string>", line 192, in <module>
File "/home/veda/acre/gluon/sqlhtml.py", line 3314, in __init__
fieldmap = dict(zip(sqlrows.colnames, sqlrows.fields))
AttributeError: 'Rows' object has no attribute 'fields'
Also, attempting to access appadmin for any table yields:Traceback (most recent call last):I think I'll just wait until the next stable release is done.
File "/home/veda/acre/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File "<string>", line 192, in <module>
File "/home/veda/acre/gluon/sqlhtml.py", line 3314, in __init__
fieldmap = dict(zip(sqlrows.colnames, sqlrows.fields))
AttributeError: 'Rows' object has no attribute 'fields'
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/1bO8XUIo0eU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
2.16.1-stable+timestamp.2017.11.14.05.54.25
(läuft auf nginx/1.10.0, Python 2.7.12)
I have tried
form = SQLFORM.grid(db.qr_info,
showblob=True,
)
and I got:<type 'exceptions.TypeError'> grid() got an unexpected keyword argument 'showblob'
What is wrong?