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/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
>

-- 



Reply via email to