Show
Ignore:
Timestamp:
02/12/07 15:27:25 (8 years ago)
Author:
ged
Message:

- Changed tests so that when one test fails, other unrelated ones don't.

- now options are initialized to their "global defaults" values instead
of hard coded values, so we can set a bunch of options on all entities.

- added a way to set custom column names for belongs_to relations.

- implemented a way to delay setup (to have a behaviour somewhat similar
to something non dynamic). This is to be used in conjunction with the
new "setup_all" function.

- made autoload work for belongs_to/has_one/has_many relations. The user
must provide column names in that case. It would be possible (and quite
easy, I think) to guess things based on foreign keys when there is only
one relation of the same type between two entities, but I haven't done
it yet, and don't plan to do it before the release. It doesn't work yet
for HasAndBelongsToMany relationships.

Files:
1 modified

Legend:

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

    r17 r47  
    88from elixir     import * 
    99 
     10#FIXME: this shouldn't be necessary. cleanup_all should handle it. The problem 
     11# is that with this damn dynamic behavior, we can't easily re-setup the  
     12# entities once they've been setup once 
     13metadata.clear() 
    1014 
    1115class Person(Entity): 
     
    1317        name = Field(Unicode(30)) 
    1418    ) 
    15      
    16     using_options(shortnames=True, order_by="name") 
    17  
    1819 
    1920class Animal(Entity): 
     
    2425     
    2526    belongs_to('owner', of_kind='Person') 
    26      
    27     using_options(shortnames=True, order_by="name") 
    2827 
    2928 
     
    3534     
    3635    def teardown(self): 
    37         drop_all() 
     36        cleanup_all() 
    3837     
    3938    def test_oneway(self):