#NEWLINE# def test_explicit( self ) : #NEWLINE# #INDENT# engineers = Table ( 'engineers' , Base . metadata , Column ( 'id' , Integer , primary_key = True , test_needs_autoincrement = True ) , Column ( 'name' , String ( 50 ) ) , Column ( 'primary_language' , String ( 50 ) ) ) #NEWLINE# managers = Table ( 'managers' , Base . metadata , Column ( 'id' , Integer , primary_key = True , test_needs_autoincrement = True ) , Column ( 'name' , String ( 50 ) ) , Column ( 'golf_swing' , String ( 50 ) ) ) #NEWLINE# boss = Table ( 'boss' , Base . metadata , Column ( 'id' , Integer , primary_key = True , test_needs_autoincrement = True ) , Column ( 'name' , String ( 50 ) ) , Column ( 'golf_swing' , String ( 50 ) ) ) #NEWLINE# punion = polymorphic_union ( { #NEWLINE# #INDENT# 'engineer' : engineers , #NEWLINE# 'manager' : managers , #NEWLINE# 'boss' : boss , #NEWLINE# #UNINDENT# } , 'type' , 'punion' ) #NEWLINE# class Employee ( Base , fixtures . ComparableEntity ) : #NEWLINE# #INDENT# __table__ = punion #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_on' : punion . c . type , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# class Engineer ( Employee ) : #NEWLINE# #INDENT# __table__ = engineers #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_identity' : 'engineer' , #NEWLINE# 'concrete' : True , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# class Manager ( Employee ) : #NEWLINE# #INDENT# __table__ = managers #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_identity' : 'manager' , #NEWLINE# 'concrete' : True , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# class Boss ( Manager ) : #NEWLINE# #INDENT# __table__ = boss #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_identity' : 'boss' , #NEWLINE# 'concrete' : True , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . _roundtrip ( Employee , Manager , Engineer , Boss )