Changeset 123

Show
Ignore:
Timestamp:
06/13/07 09:52:03 (6 years ago)
Author:
ged
Message:

- Apply suggestion from Isaac Csandl:

If the table of the associable object has an order_by clause, it will
be respected when you access the property.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/ext/associable.py

    r121 r123  
    201201                    getattr(self, attr_name).targets = [value] 
    202202                setattr(entity, self.name, property(get, set)) 
    203                  
     203 
    204204    sa.mapper(GenericAssoc, association_table, properties={ 
    205         'targets':sa.relation(entity, secondary=association_to_table,  
    206                               lazy=False, backref='association') 
     205        'targets': sa.relation(entity, secondary=association_to_table, 
     206                               lazy=False, backref='association', 
     207                               order_by=entity.mapper.order_by) 
    207208    }) 
    208209    return Statement(Associable)