Changeset 269
- Timestamp:
- 11/30/07 09:15:19 (4 years ago)
- Location:
- elixir/trunk/elixir
- Files:
-
- 2 modified
-
properties.py (modified) (1 diff)
-
relationships.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/properties.py
r267 r269 126 126 ''' 127 127 Generic catch-all class to wrap an SQLAlchemy property. 128 129 .. sourcecode:: python 130 131 class OrderLine(Entity): 132 quantity = Field(Float) 133 unit_price = Field(Numeric) 134 price = GenericProperty(lambda c: column_property( 135 (c.quantity * c.unit_price).label('price'))) 128 136 ''' 129 137 -
elixir/trunk/elixir/relationships.py
r267 r269 477 477 if 'primary_key' in kwargs: 478 478 self.column_kwargs['primary_key'] = kwargs.pop('primary_key') 479 # by default, columns created will have an index. 480 self.column_kwargs.setdefault('index', True) 479 481 480 482 self.constraint_kwargs = kwargs.pop('constraint_kwargs', {}) … … 553 555 # we can't add the column to the table directly as the table 554 556 # might not be created yet. 555 col = Column(colname, pk_col.type, index=True, 556 **self.column_kwargs) 557 col = Column(colname, pk_col.type, **self.column_kwargs) 557 558 source_desc.add_column(col) 558 559
