yes

db.memos.code.label = 'Codice'
grid = SQLFORM.grid(db.memos)

Notice that:

if grid.view_form is not None than it is the readonly form. It therefore 
contains grid.view_form.record.code but this is the field value not the 
field object and therefore it is a 'string' and it does not have a label 
attribute. grid.view_form.table.code is the Field object and it does have 
the label attributes but it is useless because the grid.view_form at this 
point has already been built.


On Sunday, 29 November 2015 11:52:30 UTC-6, Gael Princivalle wrote:
>
> Hello everybody.
>
> Is there a way in a sqlform.grid to retrieve record field labels in a 
> custom view?
> Something like that:
> grid.view_form.record.code.label
>
> To retrieve:
> db.define_table('memos',
>     Field('code', type='string', requires=IS_NOT_EMPTY(), label='*Codice*'
> ),
>
> Thanks, regards.
>

-- 
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