Hello,

I am trying to display a Field that has type 'blob' in a SQLFORM.grid. The 
data is NOT user-uploaded, thus I cannot use the typical uploadfield + 
request.download pattern. I am using blob because I need to store important 
algorithm-generated data that is too large to fit in the 'text' field type. 
I would like it to display a link to a handler.

I tried a simple test case model


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.

<https://lh3.googleusercontent.com/-WzURnD6J-gg/WNAkBA3OXRI/AAAAAAAAATw/e-ft-MN-wZ0mpln8k5CiONkzBslFepsxgCLcB/s1600/blob_grid.png>


Interestingly, the appadmin display of the table does have the represent link 
as intended. 

<https://lh3.googleusercontent.com/-zHvXKP8aHWM/WNAkJuVI3XI/AAAAAAAAAT0/BDeM8atNGksOBSoQv9G43Cdbgr_FVBvwwCLcB/s1600/blob_admin.png>




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 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/d/optout.

Reply via email to