Shouldn't acl.cod_ruolo be inside the [] - part of the first parameter
to 'select'?

The parameters to select are 'columns=None, whereclause=None,
from_obj=[], **kwargs', so your 'and_' part is going in as the from_obj
parameter, and then you are supplying another from_obj, hence the error
message.

Hope that helps,

Simon

-----Original Message-----
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Jose Soares
Sent: 02 April 2007 15:01
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] select() got multiple values for keyword argument
'from_obj'


Hi all,

I'm trying to create the following query using SA:

SELECT DISTINCT operatore.id, anagrafica.nome, acl.cod_ruolo
FROM operatore JOIN anagrafica
ON operatore.id_anagrafica = anagrafica.id
LEFT OUTER JOIN acl ON acl.id_operatore = operatore.id
LEFT OUTER JOIN ruolo_permesso ON ruolo_permesso.cod_ruolo =
acl.cod_ruolo
WHERE (ruolo_permesso.cod_permesso = 'CTR'
AND acl.id_asl IS NOT NULL AND operatore.data_fine_attivita IS NULL)

-----

select([Operatore.c.id, Anagrafica.c.nome],Acl.c.cod_ruolo,
       and_(RuoloPermesso.c.cod_permesso=='CTR',
            Acl.c.id_asl<>None,
            Operatore.c.data_fine_attivita==None),

       
from_obj=[Operatore.mapper.mapped_table.join(Anagrafica.mapper.mapped_ta
ble, 
Operatore.c.id_anagrafica == Anagrafica.c.id
                          
).outerjoin(Acl.mapper.mapped_table,                            
Acl.c.id_operatore == Operatore.c.id
                          
).outerjoin(RuoloPermesso.mapper.mapped_table,           
RuoloPermesso.c.cod_ruolo == Acl.c.cod_ruolo)],
       distinct=True)
---------

...but it gives me this error:

*exceptions.TypeError: ("select() got multiple values for keyword 
argument 'from_obj'", <bound method Controller.index of 
<sicer.controllers.veterinario_azienda.Controller instance at
0xb65c41ac>>)*

any ideas?
jo




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

Reply via email to