I still get<type 'exceptions.AttributeError'> 'DAL' object has no attribute
'table1'

You right that I didn't need call db.table._tablename and
db.table.field.name... I was just trying something else before then I
forget I didn't need to call those attributes.

Anyway, I think it is not possible since model is not yet define.

FYI dblables_en is a dict like this one {'table1field1':
'field1LableStoreInDb'}

Thanks.

Richard

On Thu, Oct 18, 2012 at 4:40 PM, Niphlod <niph...@gmail.com> wrote:

> you are asking to python to evaluate a variable that doesn't exists.
> It seems that you know the tablename and fields in advance (because
> dblabels_en is somewhat filled already) so why can't you just
>
> tablename = 'test1'
> db.define_table(tablename,
>     Field('foo', label=T(dblabels_en["%s_foo" % tablename])))
>
> ?
>
>
> On Thursday, October 18, 2012 9:57:09 PM UTC+2, Richard wrote:
>>
>> Hello,
>>
>> Is it possible to do that?
>> db.define_table(...
>> Field(...
>>     label=T(dblabels_en[db.table._**tablename+db.table.field.name]**)
>>
>> I can do
>> db.define_table(...)
>> db.table.field.lable=T(**dblabels_en[db.table._**tablename+
>> db.table.field.name]**)
>>
>> Inside table model definition "table" is not yet define then I can refer
>> to it.
>>
>> I try with lambda with no succes.
>>
>> Do you see a way to refer to the db.table._tablename in order to make it
>> execute only once that the model is defined?
>>
>> Thanks
>>
>> Richard
>>
>  --
>
>
>
>

-- 



Reply via email to