Re: [sqlalchemy] alembic handles no primary key table

2012-12-01 Thread junepeach
I have 2 simple tables defined as below: class Test1(Base): __tablename__ = 'test1' id = Column(Integer, primary_key = True) name = Column(String(15)) class Test2(Base): __tablename__ = 'test2' fid = Column(Integer, ForeignKey('test1.id')) tname = Column(String(15)) You

Re: [sqlalchemy] alembic handles no primary key table

2012-12-01 Thread Werner
On 01/12/2012 17:49, junepeach wrote: I have 2 simple tables defined as below: class Test1(Base): __tablename__ = 'test1' id = Column(Integer, primary_key = True) name = Column(String(15)) class Test2(Base): __tablename__ = 'test2' fid = Column(Integer,

Re: [sqlalchemy] alembic handles no primary key table

2012-12-01 Thread Michael Bayer
On Dec 1, 2012, at 11:49 AM, junepeach wrote: I have 2 simple tables defined as below: class Test1(Base): __tablename__ = 'test1' id = Column(Integer, primary_key = True) name = Column(String(15)) class Test2(Base): __tablename__ = 'test2' fid = Column(Integer,

Re: [sqlalchemy] Unexplainable SQL queries / Performance issues

2012-12-01 Thread Michael Bayer
both issues, same-named attributes on dual subclasses and structural subqueryloads in conjunction with with_polymorphic, are now repaired in the latest tip for 0.8 and both test scripts are functional in 0.8 now.Feel free to test it out and send me more feedback, thanks ! On Nov 23,

Re: [sqlalchemy] Creating a feed related to different object type

2012-12-01 Thread Eric Ongerth
Hi Brice, Yours is another good case of the 'Generic Associations' or 'Polymorphic Association' pattern which comes up quite often. Here's a link to some docs that will get you going on a good solution that keeps the database normalized.