Fix polymorphism problem with relationships

Since we are using subclasses of the ORM mapped classes, disable
typechecks for ORM relations
This commit is contained in:
2017-03-08 18:41:02 +01:00
parent e16925197c
commit 3fe47e666f
2 changed files with 6 additions and 11 deletions

View File

@@ -249,7 +249,8 @@ class MysqlRedFam( Mysql, Base ):
__article3_status, __article4_status, __article5_status,
__article6_status, __article7_status )
redpage = relationship( "MysqlRedPage", back_populates="redfams" )
redpage = relationship( "MysqlRedPage", enable_typechecks=False,
back_populates="redfams" )
@property
def articlesList(self):
@@ -299,8 +300,9 @@ class MysqlRedPage( Mysql, Base ):
nullable=True )
redfams = relationship(
"MysqlRedFam", order_by=MysqlRedFam.famhash, back_populates="redpage",
collection_class=attribute_mapped_collection("famhash"))
"MysqlRedFam", enable_typechecks=False,
back_populates="redpage", order_by=MysqlRedFam.famhash,
collection_class=attribute_mapped_collection("famhash") )
@property
def status( self ):