Gone!
I get my app to work under 2.0.5 without much problem, just one thing
broke, but I don't understand why for now, but it pretty not important.
So, I confirm that :
for row in db(db.table.id>0).select():
print row.id
OR
print row.legacy_id
Works.
I am pretty happy about that!
:)
Thanks
On Tue, Aug 28, 2012 at 4:13 PM, Richard Vézina <[email protected]
> wrote:
> If you want I can make a diff over 1.99.4 and 1.99.5 and try to locate
> what breaks the old behavior... Also, I understand that it was something
> experimental, but I think it is pretty usefull for legacy database users.
>
> I will try trunk tomorrow to see if your fix works as expect.
>
> Thank you Massimo.
>
> Richard
>
>
> On Tue, Aug 28, 2012 at 4:00 PM, Massimo Di Pierro <
> [email protected]> wrote:
>
>> For now I have committed a fix in trunk. I am not sure it belong there?
>> It is not obvious to me the previous behavior was better or not (the
>> feature you are using was never documented).
>>
>> Pros? Cons?
>>
>>
>> On Tuesday, 28 August 2012 11:56:13 UTC-5, Richard wrote:
>>
>>> FYI what you suggest trigger this error message :
>>>
>>> <type 'exceptions.SyntaxError'> Object exists and cannot be redefined: id
>>>
>>> Richard
>>>
>>> On Tue, Aug 28, 2012 at 12:46 PM, Richard Vézina
>>> <[email protected]>wrote:
>>>
>>>> Not sure I follow, in the pass we were allowed to define a legacy id
>>>> for a table like this :
>>>>
>>>> db.define_table('test_**endotoxin',
>>>> *Field('something_id','id'),*
>>>> Field('result','decimal(10,2)'**,
>>>> notnull=True,
>>>> requires=[IS_NOT_EMPTY(error_**message=T('field can\'t be
>>>> empty')),
>>>> IS_DECIMAL_IN_RANGE(0.00,**99999999.99)],
>>>> required=True
>>>> ),
>>>> ...)
>>>>
>>>> It still work except at the level of the row object.
>>>>
>>>> What you suggest may works, I would have to refactor and create a
>>>> virtual field for all my tables...
>>>> I was seeking for a solution that prevent me from refactoring in order
>>>> to shift from 1.99.4 to 2.0... when there will be a stable version.
>>>>
>>>> Richard
>>>>
>>>> On Tue, Aug 28, 2012 at 12:39 PM, Massimo Di Pierro <
>>>> [email protected]> wrote:
>>>>
>>>>> How about
>>>>>
>>>>> table.id = Field.Virtual(lambda row: row.table.something_id)
>>>>>
>>>>>
>>>>> On Tuesday, 28 August 2012 10:30:37 UTC-5, Richard wrote:
>>>>>>
>>>>>> Hello Massimo,
>>>>>>
>>>>>> I notice when I try to migrate to 1.99.7 some times ago that I could
>>>>>> not anymore do something like this :
>>>>>>
>>>>>> rows = db(db.table.id>0).select()
>>>>>>
>>>>>> for row in rows:
>>>>>> print row.id
>>>>>>
>>>>>> I can did it before 1.99.5.
>>>>>>
>>>>>> Has Anthony wrote in this thread : https://groups.google.com/**fo**
>>>>>> rum/#!msg/web2py/**i7wx6JVTOtw/**FRnScZzhqHgJ<https://groups.google.com/forum/#!msg/web2py/i7wx6JVTOtw/FRnScZzhqHgJ>
>>>>>>
>>>>>> We still can do :
>>>>>>
>>>>>> db.table.id even if the "real" table id name (or legacy id name) is
>>>>>> something else like : something_id
>>>>>>
>>>>>> To me it is just a matter to have a alias for any legacy id name when
>>>>>> creating a row object :
>>>>>>
>>>>>> Row in 1.99.4
>>>>>> <Row {'something_id': 252, 'update_record': <function <lambda> at
>>>>>> 0x215eaa0>, 'field1': Decimal('5.55'), *'id': 252*, 'delete_record':
>>>>>> <function <lambda> at 0x215eb18>}>
>>>>>>
>>>>>>
>>>>>> Row in 1.99.5-1.99.7
>>>>>> <Row {'something_id': 252, 'update_record': <function <lambda> at
>>>>>> 0x215eaa0>, 'field1': Decimal('5.55'), 'delete_record': <function
>>>>>> <lambda>
>>>>>> at 0x215eb18>}>
>>>>>>
>>>>>> Could we have it back or it is gone?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> Richard
>>>>>>
>>>>> --
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>
>>
>>
>>
>
>
--