예제 #1
0
 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)
예제 #2
0
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)
예제 #3
0
 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)