odd. try

print db()._select(db.dog.name, db.father.name, db.mother.name,
                   left=(db.father.on(db.father.id==db.dog.father_id),
                         db.mother.on
(db.mother.id==db.dog.mother_id)))

On Jun 9, 12:59 am, Peter Etchells <peter.a.etche...@gmail.com> wrote:
> When trying the example in the new slide show:
>  ...db = SQLDB('sqlite://storage.sqlite')
>
> db.define_table('dog',
>     SQLField('name'),
>     SQLField('father_id','reference dog'),
>     SQLField('mother_id','reference dog'))
> ..
> data:
>
> 5 selected
> dog.id  dog.name        dog.father_id   dog.mother_id
> 1       biff    None    None
> 2       bella   None    1
> 3       fred    None    2
> 4       harry   2       1
> 5       rover   3       2
>
> def index():
>     father=db.dog.with_alias('father')
>     mother=db.dog.with_alias('mother')
>     rows = db().select(db.dog.name, db.father.name, db.mother.name,
>                    left=(db.father.on(db.father.id==db.dog.father_id),
>                          db.mother.on
> (db.mother.id==db.dog.mother_id)))
>     return dict(rows=rows)
>
> I get the error:
> ... self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> OperationalError: no such table: LEFT
>
> Any ideas? thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to