Hi list,

I've a sample application that makes use of polymorphism both with and
without SQLAlchemy.

On the non-SA side, I've implemented record insertion via stored procedures.
Now, integrating new code based on SA, the ORM behaviour is to create both
the base and the inherited record. SA fails at this points because the
inherited records has already been created on the database side.

Sample error:

---
sqlalchemy.exc.IntegrityError: (IntegrityError) duplicate key value violates
unique constraint "compound_item_pkey"
 'INSERT INTO compound_item (id) VALUES (%(id)s)' {'id': 7}
---

I dont't have the option to touch the legacy (but current) code, so I expect
to be able to make SA adapt to this situation. I guess I'd need a mapper
option that does not insert inherited records or maybe ignores if they're
already there.

Do you guys think I'm in the right direction? Does SA have this already? Any
pointers to where to start to code this?

Thanks!

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

Reply via email to