UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
Update, (Still need help, I'm really puzzled on how to do this) since both Person and Company are polymorphic from Affiliation the relations are not really self referencing, So I need help defining the relation and a reference table. The reference table should however be something like this:

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Michael Bayer
Here is a demonstration program. If I understand correctly, ChildRelation is just the inverse of ParentRelation so backref can save you lots of configuration here: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base =

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
Michael, Thank you, reading trough your example (and running it) made me understand a bit more how SQLA works. I managed to get it all working, Since I was on my way to something a bit slightly more complex ...one last Question What if I would like to: Class RelationType(Base):

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Michael Bayer
On Jan 4, 2011, at 2:34 PM, Martijn Moeling wrote: Michael, Thank you, reading trough your example (and running it) made me understand a bit more how SQLA works. I managed to get it all working, Since I was on my way to something a bit slightly more complex ...one last Question