[web2py] Re: how to find and reference field names in tables

2016-04-01 Thread Anthony
Just access the .default attribute of each field. Anthony -- 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 subsc

[web2py] Re: how to find and reference field names in tables

2016-04-01 Thread lucas
ok cool, so now we know how to iterate through the fields of a table. how can we grab or get the db.py default value for each field also? thanx lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.googl

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Alex Glaros
ok, got it. Thanks Anthony! -- 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 subscribed to the Google Groups "w

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
> >> for tablename in db.tables: >> table = db[table] >> > > should this be table = db[tablename] ? > Yes, thanks. I updated the original answer. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Dave S
On Wednesday, October 28, 2015 at 9:39:52 AM UTC-7, Alex Glaros wrote: > > I want to discover the field names in db.py (I do not have them listed in > an already-existing table) > > can you help with syntax for a query? > > query = ((db.tables.field == 'organizationID') & (db.tables.field == >

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
You can't do a query looking for tables -- you have to handle that part of it in Python with code like I showed. Once you have the table names, you can then do whatever queries you want. Anthony On Wednesday, October 28, 2015 at 12:39:52 PM UTC-4, Alex Glaros wrote: > > I want to discover the f

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Dave S
On Wednesday, October 28, 2015 at 6:35:27 AM UTC-7, Anthony wrote: > > Are you saying you have a "tables" table in your db that stores all the > table and field names of the other tables in your db, and you need to know > how to query it to get particular information, or are you looking for a w

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Alex Glaros
I want to discover the field names in db.py (I do not have them listed in an already-existing table) can you help with syntax for a query? query = ((db.tables.field == 'organizationID') & (db.tables.field == 'last_name') & (db.tables.table_name.organizationID == 'California')) # so search is l

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
Are you saying you have a "tables" table in your db that stores all the table and field names of the other tables in your db, and you need to know how to query it to get particular information, or are you looking for a way to loop over all the tables you have defined and identify those that inc