More good news. I discovered that this fix now allows me to use 
SQLFORM.grid on legacy tables that don't have an 'id' field!

On Wednesday, July 25, 2012 9:10:38 PM UTC-6, tomt wrote:
>
> I tried the latest trunk, and it solves the problem I described.  This is 
> great and it will make it much easier for me to interact with my legacy 
> tables.
> I also have to thank you for the amazingly fast fix!!!
> Thanks a lot - Tom
>
> On Wednesday, July 25, 2012 8:14:14 PM UTC-6, Massimo Di Pierro wrote:
>>
>> There is a solution in trunk. Please give it a try.
>>
>> On Wednesday, 25 July 2012 20:36:07 UTC-5, tomt wrote:
>>>
>>> Hi,
>>> I was using a version of trunk.  I downloaded today's version and got 
>>> the same error.  I opened a ticket as suggested. (Issue 908)
>>>
>>> On Wednesday, July 25, 2012 7:38:47 AM UTC-6, Massimo Di Pierro wrote:
>>>>
>>>> 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
>>>>>
>>>>

-- 



Reply via email to