Ok, but I am pretty much confuse with the syntax...

I try with my own tables by kind of translating person and dog to adapt to
my need but it failed...

This work :

rows = db(db.t1.t2_id == db.t2.id).select()
for row in rows:
    print row.t2.f1 + '-' + row.t1.f1

But this don't work :

rows1 = db(db.t1).select(join=db.t1.on(db.t1.t2_id == db.t2.id))
So can't execute the lines below since the upper line has failed...
#for row in rows1:
#    print row.t2.f1 + '-' + row.t1.f1

In console I get those errors :

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1376, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1386, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1306, 0))


The only way I can execute the query (db().select()) :
rows1 = db(db.t1).select(join=db.t2.on(db.t2.id == db.t1.t2_id))
for row in rows1:
    print row.t2.f1 + '-' + row.t1.f1

In this case the for failed with with the t2.f1 since there is only t1 rows
in the output of the request (print(rows1))...

Where's my mystake?!

Richard

On Fri, Oct 21, 2011 at 10:35 AM, Anthony <abasta...@gmail.com> wrote:

> Yes, I think you could always do inner joins, and the new select(join=...)
> syntax was introduced in 1.96.1.
>
> On Friday, October 21, 2011 10:15:09 AM UTC-4, Richard wrote:
>>
>> Hello,
>>
>> I would like to make sure the inner join syntax was available in
>> 1.98.2 ?
>>
>> Thanks.
>>
>> Richard
>
>

Reply via email to