[web2py] Re: Table Name from ROWS object

2012-12-28 Thread at
yes please; it would be really helpful for beginners like me thank you On Friday, 28 December 2012 12:56:44 UTC+5, Massimo Di Pierro wrote: Apparently only in one example: http://web2py.com/books/default/search/29?search=**dict I can add something about this. On Friday, 28 December 2012

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
Yes and No. You can get rows.colnames and they contain table names . field name On Thursday, 27 December 2012 07:45:52 UTC-6, at wrote: How can we get table name from ROWS object? Thanks --

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
gr8! *tname,z=my_rows.colnames[0].split('.')* gave the desired table name thanks very much! best regards On Thursday, 27 December 2012 18:47:07 UTC+5, Massimo Di Pierro wrote: Yes and No. You can get rows.colnames and they contain table names . field name On Thursday, 27 December 2012

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
Wanted to avoid hard-coding table name in the following statement by using var *tname*, but not successful: any tip pls? *db(db.tname.id == rowid).select* Thanks On Thursday, 27 December 2012 19:10:31 UTC+5, at wrote: gr8! *tname,z=my_rows.colnames[0].split('.')* gave the desired table name

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Alan Etkin
El jueves, 27 de diciembre de 2012 11:35:55 UTC-3, at escribió: Wanted to avoid hard-coding table name in the following statement by using var *tname*, but not successful: any tip pls? * db(db.tname.id == rowid).select* You mean you must get the Table object programatically? tname = whatever

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
*db(db[tname].id http://db.tname.id/ == rowid).select* On Thursday, 27 December 2012 08:35:55 UTC-6, at wrote: Wanted to avoid hard-coding table name in the following statement by using var *tname*, but not successful: any tip pls? *db(db.tname.id == rowid).select* Thanks On Thursday,

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Anthony
* db(db[tname].id http://db.tname.id/ == rowid).select() *or just: db[tname](rowid) Anthony On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote: Wanted to avoid hard-coding table name in the following statement by using var *tname*, but not successful: any tip pls? *db(db.tname.id

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
thanks all for the prompt response help. regards On Thursday, 27 December 2012 19:41:45 UTC+5, Anthony wrote: * db(db[tname].id http://db.tname.id/ == rowid).select() *or just: db[tname](rowid) Anthony On Thursday, December 27, 2012 9:35:55 AM UTC-5, at wrote: Wanted to avoid

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
It's working when I give table_name after getting table object programatically, but when the same syntax is used for column names in update statement it returns syntax error; please consider the following statement: *db((db[table_name].id == rowid) (db[table_name][myfld] == )).update( [myfld]

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
*db((db[table_name].id == rowid) (db[table_name][myfld] == )).update( [myfld] = myvalue)* * * *should be* * * *db((db[table_name].id == rowid) (db[table_name][myfld] == )).update(**{ myfld:myvalue})* * * On Friday, 28 December 2012 00:40:15 UTC-6, at wrote: It's working when I give

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread at
thank you massimo for this interesting and very useful tip ... it would save my good amount of time btw, is this syntax available in web2py documentation? On Friday, 28 December 2012 12:05:46 UTC+5, Massimo Di Pierro wrote: *db((db[table_name].id == rowid) (db[table_name][myfld] ==

[web2py] Re: Table Name from ROWS object

2012-12-27 Thread Massimo Di Pierro
Apparently only in one example: http://web2py.com/books/default/search/29?search=**dict I can add something about this. On Friday, 28 December 2012 01:24:37 UTC-6, at wrote: thank you massimo for this interesting and very useful tip ... it would save my good amount of time btw, is this