- Timestamp:
- Oct 1, 2008, 7:48:39 PM (16 years ago)
- Location:
- trunk/packages
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-database/debian/changelog
r989 r991 3 3 * add remote and console to pg_hba.conf template 4 4 * fix init script so it works 5 * port more code to sqlalchemy 0.4 5 6 6 7 -- Greg Price <price@mit.edu> Wed, 01 Oct 2008 19:30:26 -0400 -
trunk/packages/sipb-xen-database/python/database/__init__.py
r946 r991 5 5 def connect(uri = config.db.uri): 6 6 """ Connect to a given database URI""" 7 meta.bind = sqlalchemy.create_engine(uri) 7 engine = sqlalchemy.create_engine(uri) 8 meta.bind = engine 9 session.configure(bind=engine) -
trunk/packages/sipb-xen-database/python/database/models.py
r946 r991 1 1 from sqlalchemy import * 2 from sqlalchemy import orm 2 3 from sqlalchemy.orm import create_session, relation 3 4 … … 6 7 7 8 __all__ = ['meta', 8 ' ctx',9 'session', 9 10 'clear_cache', 10 11 'machine_table', … … 26 27 27 28 meta = ThreadLocalMetaData() 28 ctx = SessionContext(create_session)29 session = orm.scoped_session(orm.sessionmaker()) 29 30 30 31 machine_table = Table('machines', meta, … … 106 107 return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id) 107 108 108 assign_mapper(ctx,Machine, machine_table,109 session.mapper(Machine, machine_table, 109 110 properties={'nics': relation(NIC, backref="machine", lazy=False), 110 111 'disks': relation(Disk, backref="machine", lazy=False), 111 112 'type': relation(Type, lazy=False), 112 113 'acl': relation(MachineAccess, backref="machine", lazy=False, passive_deletes=True, cascade="all, delete-orphan")}); 113 assign_mapper(ctx,MachineAccess, machine_access_table)114 assign_mapper(ctx,NIC, nic_table)115 assign_mapper(ctx,Disk, disk_table)116 assign_mapper(ctx,Type, types_table)117 assign_mapper(ctx,CDROM, cdroms_table)118 assign_mapper(ctx,Autoinstall, autoinstalls_table)114 session.mapper(MachineAccess, machine_access_table) 115 session.mapper(NIC, nic_table) 116 session.mapper(Disk, disk_table) 117 session.mapper(Type, types_table) 118 session.mapper(CDROM, cdroms_table) 119 session.mapper(Autoinstall, autoinstalls_table) 119 120 120 121 def clear_cache(): … … 124 125 it. Why is this so obscure?""" 125 126 126 ctx.registry.clear() 127 # XXX maybe we still need to do this, but it's not doc'd how. 128 #ctx.registry.clear() -
trunk/packages/sipb-xen-remote-server/debian/changelog
r986 r991 1 1 sipb-xen-remote-server (0.9) unstable; urgency=low 2 2 3 [Evan Broder] 3 4 * Make the acl/ subdir of RemConfFS listable 5 6 [Greg Price] 4 7 * Update RemConfFS for new SQLAlchemy code 5 8
Note: See TracChangeset
for help on using the changeset viewer.