I have been exploring the DAL examples which are under documentation
on the website.

I have got the following model:

db.define_table('person',
    db.Field('name','string'))

db.define_table('dog',
    db.Field('name'))

db.define_table('friendship',
    db.Field('person',db.person),
    db.Field('dog',db.dog))

in which I inserted a couple of persons and dogs.


The Reference Fields Inner Joins example is working, however, I don't
get the Left Outer Joins example to work.

In my controller I have got:

def myouter():
    query=(db.person.id>0)
    friends=(db.person.id==db.friendship.person)&
(db.dog.id==db.friendship.dog)
    rows=db(query).select(db.person.name,db.dog.name,left=db.dog.on
(friends))
    return dict(rows=rows)

and in the view:

{{extend 'layout.html'}}

{{for row in rows:}}
{{=row.person.name}}
is friend of
{{=row.dog.name or nobody}}
<br />

When I expose myouter I got the following error ticket:

OperationalError: no such column: friendship.dog


Does one one of you know why this ticket is issued?


Kind regards,

Annet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to