Hi everyone,

I currently use Web2py for an internal corporation application. I
recently upgraded from 1.89 to 1.90-6. Since this upgrade all my left
joins with aliased table don't work any more.
I'm using Web2py with Postgres.

For example I have this in a controller exposed function:
        Domain = dbPsnol.domain
        Client = dbPsnol.client
        Manager = dbPsnol.contact.with_alias('manager')

        infos = dbPsnol(Domain.id==request.args[0]).select(
                                Domain.ALL, Client.ALL,Manager.ALL, left=[
                                        Client.on(Client.id==Domain.client_id),
                                        
Manager.on(Manager.id==Client.manager_id)])

This example generate the following error:
        ProgrammingError: invalid reference to FROM-clause entry for table
"domain"
        LINE 1: ... domain, contact LEFT JOIN client ON (client.id =
domain.cli...
                                                             ^
        HINT:  There is an entry for table "domain", but it cannot be
referenced from this part of the query.

And as soon as I redefine Manager like this:
        Manager = dbPsnol.contact
I don't get the error any more. But the result is not what I want.

Is this a bug in the new DAL or is there an other way to do what I
want ?

Reply via email to