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

@@ -30,8 +30,7 @@ import mwparserfromhell as mwparser
import jogobot # noqa
from lib.mysqlred import MysqlRedPage, relationship
from sqlalchemy.orm.collections import attribute_mapped_collection
from lib.mysqlred import MysqlRedPage
from lib.redfam import RedFamParser
@@ -40,12 +39,6 @@ class RedPage( MysqlRedPage ):
Class for handling redundance discussion pages and archives
"""
# TODO POLYMORPHISM? of BASEClass
redfams = relationship(
"RedFamParser", order_by=RedFamParser.famhash,
back_populates="redpage",
collection_class=attribute_mapped_collection( "famhash" ) )
def __init__( self, page=None, pageid=None, archive=False ):
"""
Generate a new RedPage object based on the given pywikibot page object