From 7cb8f04f48eed7afd5befe2ce00ea3771ea79b40 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 12 Jul 2006 20:19:32 +0000 Subject: still having mappers not getting compiled...sigh... --- test/orm/polymorph.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/orm/polymorph.py b/test/orm/polymorph.py index ec7e95a0a..232bc5711 100644 --- a/test/orm/polymorph.py +++ b/test/orm/polymorph.py @@ -85,7 +85,25 @@ class MultipleTableTest(testbase.PersistTest): def test_t_t_t(self): self.do_test(True, True, True) - + def testcompile(self): + person_join = polymorphic_union( { + 'engineer':people.join(engineers), + 'manager':people.join(managers), + 'person':people.select(people.c.type=='person'), + }, None, 'pjoin') + + person_mapper = mapper(Person, people, select_table=person_join, polymorphic_on=person_join.c.type, polymorphic_identity='person') + mapper(Engineer, engineers, inherits=person_mapper, polymorphic_identity='engineer') + mapper(Manager, managers, inherits=person_mapper, polymorphic_identity='manager') + + session = create_session() + session.save(Manager(name='Tom', status='knows how to manage things')) + session.save(Engineer(name='Kurt', status='knows how to hack')) + session.flush() + print session.query(Engineer).select() + + print session.query(Person).select() + def do_test(self, include_base=False, lazy_relation=True, redefine_colprop=False): """tests the polymorph.py example, with several options: -- cgit v1.2.1