def contributors(self): return { int(k[len(self._contributor_prefix):], 36): ContributorPermissionSet.loads(v) for k, v in self._t.iteritems() if k.startswith(self._contributor_prefix) }
def get(cls, event, user): try: row = cls._byID(event._id, properties=[user._id36]) value = row[user._id36] except (tdb_cassandra.NotFound, KeyError): raise InviteNotFoundError return ContributorPermissionSet.loads(value)
def get_all(cls, event): try: invites = cls._byID(event._id)._values() except tdb_cassandra.NotFound: return {} else: return {int(k, 36): ContributorPermissionSet.loads(v) for k, v in invites.iteritems()}
def get_permissions(self, user): permission_string = self._t.get(self._contributor_key(user), "") return ContributorPermissionSet.loads(permission_string)
def contributors(self): return { int(k[len(self._contributor_prefix) :], 36): ContributorPermissionSet.loads(v) for k, v in self._t.iteritems() if k.startswith(self._contributor_prefix) }