Changeset 53
- Timestamp:
- 02/12/07 17:39:42 (6 years ago)
- Location:
- elixir/trunk
- Files:
-
- 3 modified
-
elixir/__init__.py (modified) (2 diffs)
-
elixir/entity.py (modified) (2 diffs)
-
tests/test_autoload.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/__init__.py
r52 r53 75 75 before defining your entities. 76 76 ''' 77 global delay_setup78 delay_setup = False79 77 for entity in delayed_entities: 80 78 entity.setup_table() … … 82 80 entity.setup_mapper() 83 81 delayed_entities.clear() 82 # try to setup all uninitialized relationships 83 EntityDescriptor.setup_relationships() 84 84 create_all() 85 85 -
elixir/trunk/elixir/entity.py
r51 r53 85 85 self.setup_table() 86 86 self.setup_mapper() 87 88 # try to setup all uninitialized relationships 89 EntityDescriptor.setup_relationships() 87 90 88 91 def setup_mapper(self): 89 92 ''' 90 Initializes and assign an (empty!) mapper to the given entity, which 91 needs a table defined, so it calls setup_table. 93 Initializes and assign an (empty!) mapper to the given entity, the. 92 94 ''' 93 95 if self.entity.mapper: … … 109 111 self.relationships.values()) 110 112 111 # try to setup all uninitialized relationships112 EntityDescriptor.setup_relationships()113 113 114 114 def translate_order_by(self, order_by): -
elixir/trunk/tests/test_autoload.py
r47 r53 32 32 elixir.delay_setup = True 33 33 34 class Animal(Entity): 35 # has_field('name', String(15)) 36 # has_field('color', String(15)) 37 38 belongs_to('owner', of_kind='Person', colname='owner_id') 39 belongs_to('feeder', of_kind='Person', colname='feeder_id') 40 41 using_options(autoload=True, shortnames=True) 42 34 43 class Person(Entity): 35 44 # has_field('name', Unicode(32)) … … 46 55 return s 47 56 48 class Animal(Entity):49 # has_field('name', String(15))50 # has_field('color', String(15))51 52 belongs_to('owner', of_kind='Person', colname='owner_id')53 belongs_to('feeder', of_kind='Person', colname='feeder_id')54 55 using_options(autoload=True, shortnames=True)56 57 57 58 elixir.delay_setup = False
