Show
Ignore:
Timestamp:
09/29/09 18:12:03 (3 years ago)
Author:
ged
Message:

- Added a "table_kwargs" argument on ManyToMany relationships to pass any

extra keyword arguments to the underlying Table object (handles half of
ticket #94).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/tests/test_m2m.py

    r475 r477  
    5555        assert a in b.as_ 
    5656        assert b in a.bs_ 
     57 
     58    def test_table_kwargs(self): 
     59        class A(Entity): 
     60            using_options(shortnames=True) 
     61            name = Field(String(60)) 
     62            bs_ = ManyToMany('B', table_kwargs={'info': {'test': True}}) 
     63 
     64        class B(Entity): 
     65            using_options(shortnames=True) 
     66            name = Field(String(60)) 
     67            as_ = ManyToMany('A') 
     68 
     69        setup_all(True) 
     70        A.mapper.compile() 
     71 
     72        assert A.bs_.property.secondary.info['test'] is True 
    5773 
    5874    def test_custom_global_column_nameformat(self):