#NEWLINE# @ classmethod #NEWLINE# def setup_mappers( cls ) : #NEWLINE# #INDENT# sub = cls . tables . sub #NEWLINE# Sub = cls . classes . Sub #NEWLINE# base = cls . tables . base #NEWLINE# Base = cls . classes . Base #NEWLINE# parent = cls . tables . parent #NEWLINE# Parent = cls . classes . Parent #NEWLINE# subparent = cls . tables . subparent #NEWLINE# Subparent = cls . classes . Subparent #NEWLINE# mapper ( Parent , parent , polymorphic_on = parent . c . type , polymorphic_identity = 'b' ) #NEWLINE# mapper ( Subparent , subparent , inherits = Parent , polymorphic_identity = 's' , properties = { #NEWLINE# #INDENT# 'children' : relationship ( Sub , order_by = base . c . id ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# mapper ( Base , base , polymorphic_on = base . c . type , polymorphic_identity = 'b' ) #NEWLINE# mapper ( parent , sub , inherits = Base , polymorphic_identity = 's' )