[web2py] Re: labels in crud.select

2010-10-18 Thread Alex
No problem. The fields attribute shouldn't affect the headers attribute and vice versa. You should be able to hide columns with the Fields attribute. Good luck! On Oct 18, 11:13 am, Richard Vézina wrote: > Ok! > > It works, thanks Alex > > I will have much more work since fields=['field1','fie

Re: [web2py] Re: labels in crud.select

2010-10-18 Thread Richard Vézina
Ok! It works, thanks Alex I will have much more work since fields=['field1','field etc.'] broke the behavior of the headers dict... So I can't hide field I don't want to show... I probably must specify a query that will only include the column I want... Richard On Fri, Oct 15, 2010 at 7:29 PM,

[web2py] Re: labels in crud.select

2010-10-15 Thread Alex
Here you go, I just tested this: selected=crud.select(table, headers={'table.field1': 'capitalize'}) You have to explicitly specify the table name of the field you want to label. On Oct 15, 4:54 pm, Richard Vézina wrote: > I try in many ways with no success... > > I read somewhere that hea

Re: [web2py] Re: labels in crud.select

2010-10-15 Thread Richard Vézina
I try in many ways with no success... I read somewhere that headers='fieldName:capitalize' was the only parameter for headers accepted... What I did : selected=crud.select(table,field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,field_labels={'field1':'abc'

[web2py] Re: labels in crud.select

2010-10-15 Thread Alex
Maybe it's the syntax? headers={'person.name': 'Name', 'table.colName': 'MyNewName'} Not: headers='fieldName:capitalize' On Oct 15, 8:00 am, Richard Vézina wrote: > Hello, > > It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. > > I try with fields=['myfield1','myfi

Re: [web2py] Re: labels in crud.select

2010-10-15 Thread Richard Vézina
Hello, It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. I try with fields=['myfield1','myfield2'] and without it always with field_labels and also with and without headers='fieldname:capitalize'... Is it a issue? Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex wrote: >

Re: [web2py] Re: labels in crud.select

2010-10-14 Thread Richard Vézina
Thanks Alex, It will help I think, I try tomorrow. Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex wrote: > Are you trying to display a more user friendly column name rather than > the DB column name? > > If so, you can do this already. The crud.select() has a method called > "field_labels", wh

[web2py] Re: labels in crud.select

2010-10-14 Thread Alex
Are you trying to display a more user friendly column name rather than the DB column name? If so, you can do this already. The crud.select() has a method called "field_labels", which takes a dictionary of field names to their labels. http://www.web2py.com/book/default/chapter/07#Methods crud.se