how to SELECT from multiple tables?

132 views
Skip to first unread message

berry

unread,
May 25, 2012, 9:29:58 AM5/25/12
to buzhug
what's the way to select by a field that's in another table?


parent_db= Base('t1').create( ('child_name', str) )
child_db= Base('t2').create( ('parent_name', str), ('parent',
parent_db ) )

parent_db.insert( name='jean')
parent_db.insert( name='jacques')
parent_db.insert( name='paul')
parent_db.insert( name='philip')
parent_db.insert( name='anne')
parent_db.insert( name='marie')

child_db.insert(name='itsik', parent_db[3] )

children = child_db.select( ['name'], parent=parent_db[3] ) ----> Got
en Error:
ValueError: If argument is a list, only 2 values should be
passed (found 3)

is it a bug or is there another way to search in "lookup tables" ?

Pierre Quentel

unread,
Jun 4, 2012, 3:25:43 AM6/4/12
to buz...@googlegroups.com
Hi,

Your example had a few syntax errors, but there is a bug in buzhug when using select() with an argument referencing another base

I fixed it (hopefully) ; can you test the latest version on the SVN repository ?

Thanks for the report
Pierre
 

yalla balagan

unread,
Jun 9, 2012, 8:00:46 AM6/9/12
to buz...@googlegroups.com
sorry

i didn't see your email
i noticed a bug that makes difference between "select()" and [ rec for rec in db ]
so i'm using only the last syntax.
i will test it during the week at work.

thanks again!

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes buzhug.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msg/buzhug/-/B1vHc9gBJRUJ.

Pour envoyer un message à ce groupe, adressez un e-mail à buz...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse buzhug+un...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/buzhug?hl=fr



--
יאללה בלגאן!!!


malamar

unread,
Mar 9, 2014, 1:34:43 AM3/9/14
to buz...@googlegroups.com
This is working with the latest version from SVN, but the PyPI version still has the bug.

Reply all
Reply to author
Forward
0 new messages