Show
Ignore:
Timestamp:
11/30/07 09:15:19 (4 years ago)
Author:
ged
Message:

- the columns created by ManyToOne relationships create an index by default,

but this is only a default now instead of an hardcoded value: it can be
disabled now (through column_kwargs). Suggestion by Jason R. Coombs.

- added example of GenericProperty in docstring

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/properties.py

    r267 r269  
    126126    ''' 
    127127    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'))) 
    128136    ''' 
    129137