[web2py] Re: How can I improve this clunky code..!

2015-11-09 Thread Edward Shave
for anyone else like me who didn't recognize this part (f == f.referent for f in db[table_name]._references) Look up Generator Expressions -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/w

[web2py] Re: How can I improve this clunky code..!

2015-11-09 Thread Edward Shave
Anthony, What a brilliant answer..!!! Thank you so much. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscr

[web2py] Re: How can I improve this clunky code..!

2015-11-09 Thread Anthony
> > >>> table.name='entry' > I assume that should be "table_name". > >>> table=eval('db.'+table_name) > No need to use eval -- just do db[table_name]. > > >>> field_names=table.fields > >>> print field_names > ['id', 'txn_id', 'acc_id', 'debit', 'credit'] > No need to store field names --