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
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,
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,
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,
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.