synergetic
synergetic

Reputation: 8056

web2py DAL multiple left joins

Is it possible? I tried the following:

rows=db().select(db.division.ALL, db.department.ALL, db.section.ALL, \
    left=db.section.on(db.department.id==db.section.department_id) & \
    db.department.on(db.division.id==db.department.division_id))

Error says & is not supported.

Upvotes: 3

Views: 3244

Answers (1)

Anthony
Anthony

Reputation: 25536

Try it as a list:

left=[db.section.on(db.department.id==db.section.department_id),
      db.department.on(db.division.id==db.department.division_id)]

Upvotes: 8

Related Questions