summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2008-07-21 21:20:16 (GMT)
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2008-07-21 21:20:16 (GMT)
commit99635d0efea78a197cf667087d43f380a7da4e03 (patch)
tree07d903b3ab2c0772ab37f7ebbb6bba0667d73720
parent2c79cd1cbf269a5535010b06233786baa0cbae69 (diff)
downloadfas-99635d0efea78a197cf667087d43f380a7da4e03.zip
fas-99635d0efea78a197cf667087d43f380a7da4e03.tar.gz
fas-99635d0efea78a197cf667087d43f380a7da4e03.tar.xz
Adds roles on People*
-rw-r--r--fas/model/fasmodel.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/fas/model/fasmodel.py b/fas/model/fasmodel.py
index c564dfa..8de96ea 100644
--- a/fas/model/fasmodel.py
+++ b/fas/model/fasmodel.py
@@ -166,11 +166,12 @@ visit_identity_table = Table('visit_identity', metadata,
# Mapped Classes
#
+admin_group = config.get('admingroup', 'accounts')
+system_group = config.get('systemgroup', 'fas-system')
+
class People(SABase):
'''Records for all the contributors to Fedora.'''
- admin_group = config.get('admingroup', 'accounts')
- system_group = config.get('systemgroup', 'fas-system')
@classmethod
def by_id(cls, id):
@@ -596,15 +597,21 @@ mapper(VisitIdentity, visit_identity_table,
def FilterClass(table):
class SomeClass(People):
pass
- mapper(SomeClass, table, properties = {
- 'group_roles': relation(PersonRoles,
- collection_class = attribute_mapped_collection('groupname'),
- primaryjoin = table.c.id == PersonRolesTable.c.person_id),
- 'approved_roles': relation(ApprovedRoles,
- primaryjoin = table.c.id == ApprovedRoles.c.person_id),
- 'unapproved_roles': relation(UnApprovedRoles,
- primaryjoin = table.c.id == UnApprovedRoles.c.person_id)
- })
+ mapper(SomeClass, table, properties = dict(
+ group_roles= relation(PersonRoles,
+ collection_class =
+ attribute_mapped_collection('groupname'),
+ primaryjoin =
+ table.c.id == PersonRolesTable.c.person_id),
+ approved_roles= relation(ApprovedRoles,
+ primaryjoin =
+ table.c.id == ApprovedRoles.c.person_id),
+ unapproved_roles= relation(UnApprovedRoles,
+ primaryjoin =
+ table.c.id == UnApprovedRoles.c.person_id),
+ roles= relation(PersonRoles,
+ primaryjoin =
+ PersonRolesTable.c.person_id==table.c.id)))
return SomeClass
PeopleSelf = FilterClass(PeopleSelfSelect)