Changeset 324 for elixir/trunk/elixir/entity.py
- Timestamp:
- 04/29/08 17:42:06 (5 years ago)
- Files:
-
- 1 modified
-
elixir/trunk/elixir/entity.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/entity.py
r323 r324 415 415 416 416 if self.polymorphic: 417 if self.children and not self.parent:417 if self.children: 418 418 if self.inheritance == 'concrete': 419 419 keys = [(self.identity, self.entity.table)] 420 420 keys.extend([(child._descriptor.identity, child.table) 421 421 for child in self._get_children()]) 422 #XXX: we might need to change the alias name so that 423 # children (which are parent themselves) don't end up 424 # with the same alias than their parent? 422 425 pjoin = polymorphic_union( 423 426 dict(keys), self.polymorphic, 'pjoin') 424 kwargs['select_table'] = pjoin 427 428 kwargs['with_polymorphic'] = ('*', pjoin) 425 429 kwargs['polymorphic_on'] = \ 426 430 getattr(pjoin.c, self.polymorphic) 427 el se:431 elif not self.parent: 428 432 kwargs['polymorphic_on'] = \ 429 433 self.get_column(self.polymorphic) 434 430 435 #TODO: this is an optimization, and it breaks the multi 431 436 # table polymorphic inheritance test with a relation.
