Changeset 240
- Timestamp:
- 10/23/07 18:20:28 (6 years ago)
- Location:
- elixir/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
elixir/relationships.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/CHANGES
r238 r240 61 61 mapper option so that it can actually be used. This allows to have entities 62 62 without any primary key defined at the table level. 63 - Added the possibility to give a custom name for ManyToOne constraints 64 (patch from and closes ticket #16) 63 65 - Dropped support for the old threadlocal SA extension (which doesn't even exist 64 66 anymore in SA 0.4) -
elixir/trunk/elixir/relationships.py
r236 r240 570 570 571 571 # build up the primary join. This is needed when you have 572 # several belongs_to relations between two objects572 # several belongs_to relationships between two objects 573 573 self.primaryjoin_clauses.append(col == pk_col) 574 574 575 # In some databases (at lease MySQL) the constraint name needs to 576 # be unique for the whole database, instead of per table. 577 fk_name = "%s_%s_fk" % (source_desc.tablename, 578 '_'.join(fk_colnames)) 575 if 'name' not in self.constraint_kwargs: 576 # In some databases (at least MySQL) the constraint name needs 577 # to be unique for the whole database, instead of per table. 578 fk_name = "%s_%s_fk" % (source_desc.tablename, 579 '_'.join(fk_colnames)) 580 self.constraint_kwargs['name'] = fk_name 581 579 582 source_desc.add_constraint( 580 ForeignKeyConstraint(fk_colnames, fk_refcols, name=fk_name,583 ForeignKeyConstraint(fk_colnames, fk_refcols, 581 584 **self.constraint_kwargs)) 582 585
