On Jan 23, 2008, at 2:15 PM, maxi wrote:

>
> Sorry, I'am a little confuse abut it. (I have only one session)
>
> I've the next table schema:
>
> convenio(conv_id)  <--- conv_pre(conv_pre_id, conv_id, pre_id)  --->
> prestacion(pre_id)    (convenio many to many with prestacion across
> conv_pre)
>
> conv_pre has a unique index on (conv_id, pre_id) but conv_pre_id is
> the primary key
>
> Then, for simplify, I've this mapper:
>
> mapper(Convenio, convenio, properties={
>       'prestaciones': relation(Prestacion,
> secondary=convenio_prestacion, lazy=True)
>    }
> )
>
>
> Now, I want to do:
>
> pre = session.query(Prestacion).get(123)
>
> conv = session.query(Convenio).get(1)
>
> conv.prestaciones.delete(pre)
>
> And this, must delete one record from conv_pre table where conv_id = 1
> and pre_id = 123 (pre.pre_id)
>
> I don't understand why this error ocurr.
> You can explain me, please?
>
> Thanks so much for your help.

do you have anything else mapped to the "conv_pre" table ?  it should  
*only* be mentioned in one place in your mapping setup.




--~--~---------~--~----~------------~-------~--~----~
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