def thing_attr(self, thing, attr): if attr == "permissions": return [ perm for perm, has in thing.permissions.permissions.iteritems() if has ] else: return UserTableItemJsonTemplate.thing_attr(self, thing, attr)
class ContributorTableItemJsonTemplate(UserTableItemJsonTemplate): _data_attrs_ = UserTableItemJsonTemplate.data_attrs( permissions="permissions", ) def thing_attr(self, thing, attr): if attr == "permissions": return [perm for perm, has in thing.permissions.permissions.iteritems() if has] else: return UserTableItemJsonTemplate.thing_attr(self, thing, attr)
def thing_attr(self, thing, attr): if attr == "permissions": return [perm for perm, has in thing.permissions.permissions.iteritems() if has] else: return UserTableItemJsonTemplate.thing_attr(self, thing, attr)