Apologies if a repeat post (my mac is in the shop and working with
this ... laptop... and nothing about it seems to work :(
Anyways, my attempt at replying was something like, using dots after
brackets should be fine, i do things like this and have no problems:
'''--- select from tables ---'''
def select(self,tbl,var):
db= self.db
for mTbl in db.tables:
if tbl in mTbl:
if mTbl.startswith(tbl):
for row in db(db[mTbl].name==var).select():
if row.name == var:
return row.value
The idea is make sure you mean var for object table and not variable
for the name for object table when talking to "db" about an un-named
table (alright, probably my wost sentence in English "ever", but the
examples says it better ;)
Mart :)
On Feb 22, 11:37 am, Richard Vézina <[email protected]>
wrote:
> No, it works...
>
> I do not know if it should be like this and if it will be always the case...
>
> Richard
>
> On Tue, Feb 22, 2011 at 10:48 AM, Ross Peoples <[email protected]>wrote:
>
>
>
>
>
>
>
> > something like this should work:
>
> > my_object = db(db[table_name]['id']==my_id).select().first()
>
> > If you use brackets instead of dot notation for table names, you may not be
> > able to use dot notation for the field name. I don't know for sure, but
> > instead of doing this:
>
> > db[key].id
>
> > Try this instead:
>
> > db[key]['id']
>
> > I'm new to all of this, so I hope this helps.