[sqlalchemy] Defining a relationship without a foreign key constraint?

2011-03-15 Thread recurse
I'm wondering if there is a way to define a relationship without creating an associated foreign key constraint in the database. It seems like relationship() requires me to define a foreign key, and that in turn automatically creates a foreign key constraint. I'm currently using the declarative

Re: [sqlalchemy] Defining a relationship without a foreign key constraint?

2011-03-15 Thread Mike Conley
The foreign key and join condition can be specified as part of the relation definition without having the foreign key existing in the database class User(Base): __tablename__ = 'users' logon = Column(String(10), primary_key=True) group_id = Column(Integer) class Group(Base):