summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-03-21 20:39:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-03-21 20:39:31 +0000
commit98367bec932c3da2243e4243d07f7fceb06484b6 (patch)
tree813726ae824fc654a83a3286eded1e13b62dd409 /src/lib
parentb7f6cc4e326cf6fad8bcb248dbfb6b4e633b41c2 (diff)
downloadbcfg2-98367bec932c3da2243e4243d07f7fceb06484b6.tar.gz
bcfg2-98367bec932c3da2243e4243d07f7fceb06484b6.tar.bz2
bcfg2-98367bec932c3da2243e4243d07f7fceb06484b6.zip
Snapshots: add modeling for administrator-to-client/group mappings
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5134 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Snapshots/model.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/Server/Snapshots/model.py b/src/lib/Server/Snapshots/model.py
index 8209eeab7..d996812c6 100644
--- a/src/lib/Server/Snapshots/model.py
+++ b/src/lib/Server/Snapshots/model.py
@@ -32,11 +32,16 @@ admin_client = Table('admin_client', Base.metadata,
Column('admin_id', Integer, ForeignKey('administrator.id')),
Column('client_id', Integer, ForeignKey('client.id')))
+admin_group = Table('admin_group', Base.metadata,
+ Column('admin_id', Integer, ForeignKey('administrator.id')),
+ Column('group_id', Integer, ForeignKey('group.id')))
+
class Client(Uniquer, Base):
__tablename__ = 'client'
id = Column(Integer, primary_key=True)
name = Column(Unicode(64), unique=True)
- admins = relation("Administrator", secondary=admin_client)
+ admins = relation("Administrator", secondary=admin_client,
+ backref='clients')
active = Column(Boolean, default=True)
online = Column(Boolean, default=True)
online_ts = Column(DateTime)
@@ -45,6 +50,8 @@ class Group(Uniquer, Base):
__tablename__ = 'group'
id = Column(Integer, primary_key=True)
name = Column(Unicode(32), unique=True)
+ admins = relation("Administrator", secondary=admin_group,
+ backref='groups')
class ConnectorKeyVal(Uniquer, Base):
__tablename__ = 'connkeyval'