Please open a ticket. This can be fixed if not fixed already. Using trunk
or stable?
On Tuesday, 24 July 2012 23:28:29 UTC-5, tomt wrote:
>
> I use several legacy tables in my web2py applications
> A typical definition that I use is:
> db2.define_table('analogpoint',
> Field('pointnumber','integer',writable=False),
> Field('pointname','string',writable=False),
> primarykey=['pointnumber'],
> migrate=False
> )
>
> I can access this table with DAL:
> info = db2(db2.analogpoint.pointnumber == point) \
> .select(db2.analogpoint.pointnumber,db2.analogpoint.pointname)
>
> but the following method generates an error:
> temp = db2.analogpoint[1].pointname
> KeyError: '_id'
>
> Is there a way to use this method on a table that doesn't have an 'id'
> field
>
> I have had success when I generate a view that includes an 'id' field
> for every legacy table, but I would like to avoid this if possible.
>
> - Tom
>
--