Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def __init__(self, request, data, for_admin):
- """Initializes this component.
- """
- self.for_admin = for_admin
- self.idx = 7 if for_admin else 8
- r = data.redirect
- list_config = lists.ListConfiguration(add_key_column=False)
- list_config.addColumn('key', 'Key', (lambda ent, *args: "%s" % (
- ent.keyName())), hidden=True)
- list_config.addColumn('org', 'Organization',
- (lambda ent, *args: ent.organization.name))
- list_config.addColumn('role', 'Role',
- (lambda ent, *args: ent.role),
- options=[('mentor', 'Mentor'), ('org_admin', 'Org Admin')])
- actions = [('pending', 'Action Required'),
- ('accepted|rejected', 'Handled'),
- ('delayed|needs_info', 'Standby'),
- ('withdrawn', 'Withdrawn')]
- list_config.addColumn('user', 'User',
- (lambda ent, *args: ent.user.name))
- if self.for_admin:
- list_config.addColumn('user_action', 'Status',
- (lambda ent, *args: ent.user_action),
- options=actions)
- else:
- list_config.addColumn('org_action', 'Status',
- (lambda ent, *args: ent.org_action),
- options=actions)
- list_config.setRowAction(
- lambda ent, *args: r.request(ent).url())
- self._list_config = list_config
- super(ConnectionComponent, self).__init__(request, data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement