Changeset 534 for elixir/trunk/elixir/entity.py
- Timestamp:
- 01/29/11 20:53:10 (16 months ago)
- Files:
-
- 1 modified
-
elixir/trunk/elixir/entity.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/entity.py
r532 r534 199 199 tablename = parent_desc.table_fullname 200 200 join_clauses = [] 201 fk_columns = [] 201 202 for pk_col in parent_desc.primary_keys: 202 203 colname = options.MULTIINHERITANCECOL_NAMEFORMAT % \ … … 208 209 # attached to a table 209 210 pk_col_name = "%s.%s" % (tablename, pk_col.key) 210 fk = ForeignKey(pk_col_name, ondelete='cascade') 211 col = Column(colname, pk_col.type, fk, 212 primary_key=True) 211 col = Column(colname, pk_col.type, primary_key=True) 212 fk_columns.append(col) 213 213 self.add_column(col) 214 214 join_clauses.append(col == pk_col) 215 215 self.join_condition = and_(*join_clauses) 216 self.add_constraint( 217 ForeignKeyConstraint(fk_columns, 218 parent_desc.primary_keys, ondelete='CASCADE')) 216 219 elif self.inheritance == 'concrete': 217 220 # Copy primary key columns from the parent.
