Changeset 216
- Timestamp:
- 09/25/07 18:31:21 (6 years ago)
- Location:
- elixir/trunk
- Files:
-
- 2 modified
-
elixir/entity.py (modified) (1 diff)
-
tests/test_autosetup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/entity.py
r214 r216 645 645 def __getattribute__(cls, name): 646 646 if type.__getattribute__(cls, "_ready"): 647 #TODO: we need to add all assign_mapper methods 648 if name in ('c', 'table', 'mapper'): 647 #TODO: we might want to add all columns that will be available as 648 #attributes on the class itself (in SA 0.4). This would be a pretty 649 #rare usecase, as people will hit the query attribute before the 650 #column attributes, but still... 651 if name in ('c', 'table', 'mapper', 'query'): 649 652 elixir.setup_all() 650 653 return type.__getattribute__(cls, name) -
elixir/trunk/tests/test_autosetup.py
r215 r216 51 51 assert isinstance(metadata.tables['person'], Table) 52 52 53 def test_query(self): 54 class Person(Entity): 55 has_field('name', Unicode(30)) 56 using_options(tablename='person') 57 58 q = Person.query 59 assert isinstance(metadata.tables['person'], Table) 60
