[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread Anthony
Sorry, forgot that the label will get escaped. Anyway, there is now a fix in trunk. On Saturday, December 17, 2011 4:58:49 PM UTC-5, brushek wrote: > > > The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to > > translate field.label without first converting to a string in case

[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread brushek
> The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to > translate field.label without first converting to a string in case the > label is an HTML helper. > > Should be an easy fix, but for now, you can do: > > label=str(IMG(...)) > > or > > label=IMG(...).xml() None of this sou

[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread Anthony
The bug isn't with LABEL, it's with SQLFORM.search_menu, which tries to translate field.label without first converting to a string in case the label is an HTML helper. Should be an easy fix, but for now, you can do: label=str(IMG(...)) or label=IMG(...).xml() either of which will convert the

[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-17 Thread brushek
But... LABEL have some bug: http://code.google.com/p/web2py/issues/detail?id=566 On 16 Gru, 23:32, Anthony wrote: > In your table definition, you can specify a 'label' argument for each > field, and I think that can be whatever you want (e.g., an IMG tag, etc.). > > db.define_table('mytable',

[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-16 Thread brushek
Thank You, Anthony. It was... so easy!!! I was looking for some very strange and wierd solutions, big + for You :). regards brushek On 16 Gru, 23:32, Anthony wrote: > In your table definition, you can specify a 'label' argument for each > field, and I think that can be whatever you want (e.g., a

[web2py] Re: SQLFORM.grid custom labels in edit form for each row

2011-12-16 Thread Anthony
In your table definition, you can specify a 'label' argument for each field, and I think that can be whatever you want (e.g., an IMG tag, etc.). db.define_table('mytable', Field('myfield', label=IMG(_src=URL('static','img/myimage.png' Haven't tried it, but hopefully should work. Anthony O