No SQLFORM.grid does not support  keyed tables. Sorry.

On Thursday, 16 August 2012 07:23:15 UTC-5, Mandar Vaze wrote:
>
> I've an associate table for many-to-many relationship with composite 
> key defined as follows :
>
> db.define_table('user_skill', 
>     Field('user', db.user), 
>     Field('skill', db.skill),
>     primarykey=['user', 'skill'])
>
> When I use SQLFORM.grid for the above table, I get the following error :
>
>   File "/home/mandar/web2py/gluon/sqlhtml.py", line 1596, in grid
>     field_id = tables[0]._id
>   File "/home/mandar/web2py/gluon/dal.py", line 7357, in __getattr__
>     return self[key]
>   File "/home/mandar/web2py/gluon/dal.py", line 7297, in __getitem__
>     return dict.__getitem__(self, str(key))
> KeyError: '_id'
>
> SQLFORM.grid seems to be looking explicitly for 'id' field hence the error.
>
> Is there a workaround ?
>
> Thanks,
> -Mandar
>
>

-- 



Reply via email to