Changeset 302
- Timestamp:
- 02/07/08 14:30:31 (5 years ago)
- Location:
- elixir/trunk
- Files:
-
- 3 modified
-
CHANGES (modified) (1 diff)
-
elixir/entity.py (modified) (1 diff)
-
tests/test_inherit.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/CHANGES
r301 r302 22 22 options) if it doesn't use any statement itself. 23 23 - Made inheritance work for custom base classes (closes #25). 24 - Fixed the inverse relationship matching when the inverse relationship is 25 defined in a parent Entity (thanks to Alexandre da Silva). 24 26 - Fixed bug in setup_entities (it always used the global entity list and not 25 27 the list given as argument). -
elixir/trunk/elixir/entity.py
r300 r302 530 530 return rel 531 531 if self.parent: 532 return self.parent. find_relationship(name)532 return self.parent._descriptor.find_relationship(name) 533 533 else: 534 534 return None -
elixir/trunk/tests/test_inherit.py
r300 r302 65 65 cleanup_all(True) 66 66 67 def test_singletable_inheritance(self):68 do_tst('single', False, True, {69 'A': ('A', 'A', 'A', 'A', 'A'),70 'B': ('B', 'B', 'B', 'B', 'B'),71 'C': ('C', 'C', 'C', 'C', 'C'),72 'D': ('D', 'D', 'D', 'D', 'D'),73 'E': ('E', 'E', 'E', 'E', 'E')74 })75 76 67 # this is related to SA ticket 866 77 68 # http://www.sqlalchemy.org/trac/ticket/866 … … 113 104 # assert not B.table.select().execute().fetchall() 114 105 106 def test_inverse_matching_on_parent(self): 107 options_defaults['inheritance'] = 'multi' 108 109 class Person(Entity): 110 using_options(inheritance='multi') 111 112 name = Field(UnicodeText) 113 114 class Parent(Person): 115 using_options(inheritance='multi') 116 childs = ManyToMany('Child', tablename='child_parent', 117 inverse='parents') 118 119 class Child(Person): 120 using_options(inheritance='multi') 121 122 parents = ManyToMany('Parent', tablename='child_parent', 123 inverse='childs') 124 125 setup_all() 126 127 def test_singletable_inheritance(self): 128 do_tst('single', False, True, { 129 'A': ('A', 'A', 'A', 'A', 'A'), 130 'B': ('B', 'B', 'B', 'B', 'B'), 131 'C': ('C', 'C', 'C', 'C', 'C'), 132 'D': ('D', 'D', 'D', 'D', 'D'), 133 'E': ('E', 'E', 'E', 'E', 'E') 134 }) 135 115 136 def test_polymorphic_singletable_inheritance(self): 116 137 do_tst('single', True, True, {
