Ignore:
Timestamp:
06/30/10 20:40:06 (23 months ago)
Author:
dart
Message:

LoReality?:
o Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loreality/loreality/model/__init__.py

    r2097 r2098  
    1818 
    1919# Non-reflected tables may be defined and mapped at module level 
    20 #users_table = sa.Table("Users", meta.metadata, 
    21 #    sa.Column("id", sa.types.Integer, primary_key=True), 
    22 #    sa.Column("login", sa.types.String(255), nullable=False), 
    23 #    ) 
    24 # 
    25 #class User(object): 
    26 #    pass 
    27 # 
    28 #orm.mapper(User, users_table) 
     20users_table = sa.Table("Pilots", meta.metadata, 
     21    sa.Column("id", sa.types.Integer, primary_key=True), 
     22    sa.Column("login", sa.types.String(255), nullable=False), 
     23    sa.Column("squadron", sa.types.String(255), nullable=False), 
     24    ) 
     25mission_table = sa.Table("Missions", meta.metadata, 
     26    sa.Column("id", sa.types.Integer, primary_key=True), 
     27    sa.Column("name", sa.types.String(255), nullable=False), 
     28    ) 
     29 
     30class User(object): 
     31    pass 
     32 
     33class Mission(object): 
     34    pass 
     35 
     36 
     37orm.mapper(User, users_table) 
     38orm.mapper(Mission, mission_table) 
    2939 
    3040 
Note: See TracChangeset for help on using the changeset viewer.