Still your original code should have worked. Please submit a bug report.

On Thursday, 10 May 2012 05:26:57 UTC-5, François Delpierre wrote:
>
> Houhou !
>
> If works also on the smartgrid :
> form = SQLFORM.smartgrid(
>             db.t_xlsfile,
>             fields=[
>                     db.t_xlsfile.f_xlsfile,
>                     ],
>                 ),
>
>
> smartgrid are really powerful, but still missing some docs... I had some 
> difficulties to find also how to get the exact display before I found the 
>  singular keyword on the table ;-)
>
> Great,
>
>
>
> Thanks,
>
> Le jeudi 10 mai 2012 06:57:00 UTC+2, Massimo Di Pierro a écrit :
>>
>> Can you try:
>>
>> form = SQLFORM.grid(
>>             db.t_xlsfile,
>>             fields=[
>>                     db.t_xlsfile.f_xlsfile,
>>                     ],
>>                 ),
>>
>> do you get the same error. Can you try web2py trunk as well?
>>
>>
>> On Wednesday, 9 May 2012 19:08:31 UTC-5, François Delpierre wrote:
>>>
>>> Hi,
>>>
>>> When I try to select the fields to be displayed as follow :
>>>     form = SQLFORM.smartgrid(
>>>             db.t_xlsfile,
>>>             fields=dict(
>>>                 t_xlsfile=[
>>>                     db.t_xlsfile.f_xlsfile,
>>>                     ],
>>>                 ),
>>>
>>> I immediately get this strange error :
>>> Traceback (most recent call last):
>>>   File "/home/www-data/web2py/gluon/restricted.py", line 205, inrestricted
>>>     exec ccode in environment
>>>   File 
>>> "/home/www-data/web2py/applications/init/controllers/default.py",line 
>>> 425, in <module>
>>>   File "/home/www-data/web2py/gluon/globals.py", line 173, in <lambda>
>>>     self._caller = lambda f: f()
>>>   File "/home/www-data/web2py/gluon/tools.py", line 2575, in f
>>>     return action(*a, **b)
>>>   File 
>>> "/home/www-data/web2py/applications/init/controllers/default.py",line 
>>> 257, in posting_history
>>>     t_xlsfile='Table of Excel files',
>>>   File "/home/www-data/web2py/gluon/sqlhtml.py", line 1989, in smartgrid
>>>     user_signature=user_signature,**kwargs)
>>>   File "/home/www-data/web2py/gluon/sqlhtml.py", line 1517, in grid
>>>     if field._tablename in tablenames]
>>> AttributeError: 'str' object has no attribute '_tablename'
>>>
>>> Any idea ??
>>>
>>

Reply via email to