Add Wrapperclass for Parser to RedPage
Add a wrapper class to overwrite type of Items returned by RedPage.redfams relationship Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=109 FS#109]
This commit is contained in:
@@ -30,7 +30,8 @@ import mwparserfromhell as mwparser
|
||||
|
||||
import jogobot # noqa
|
||||
|
||||
from lib.mysqlred import MysqlRedPage
|
||||
from lib.mysqlred import (
|
||||
MysqlRedPage, relationship, attribute_mapped_collection )
|
||||
from lib.redfam import RedFamParser
|
||||
|
||||
|
||||
@@ -131,3 +132,12 @@ class RedPage( MysqlRedPage ):
|
||||
Calls flush method of Mysql Interface class
|
||||
"""
|
||||
cls.session.commit()
|
||||
|
||||
|
||||
class RedPageParser( RedPage ):
|
||||
"""
|
||||
Wrapper class to change the type of redfams collection elements in parser
|
||||
"""
|
||||
redfams = relationship(
|
||||
"RedFamParser", enable_typechecks=False, back_populates="redpage",
|
||||
collection_class=attribute_mapped_collection("famhash") )
|
||||
|
||||
Reference in New Issue
Block a user