Tip: Click lines to highlight, hold ctrl/cmd to multi-select
http://codedumper.com/oleqe (24-May @ 05:50)
Syntax Highlighted Code
- class MemberListing(grok.View):
- def fieldNames(self):
- return (f for f in IUser)
- def members(self):
- pau = component.getUtility(IAuthentication)
- principals = pau['principals']
- roster = [ ]
- for id in sorted(principals.keys()):
- print id
- print principals[id]
- user = IUser(principals[id]) # <----- this is where the code is breaking
- fields = {}
- for field in IUser:
- fields[field] = getattr(user, field)
- roster.append(fields)
- return roster
Plain Code
class MemberListing(grok.View):
def fieldNames(self):
return (f for f in IUser)
def members(self):
pau = component.getUtility(IAuthentication)
principals = pau['principals']
roster = [ ]
for id in sorted(principals.keys()):
print id
print principals[id]
user = IUser(principals[id]) # <----- this is where the code is breaking
fields = {}
for field in IUser:
fields[field] = getattr(user, field)
roster.append(fields)
return roster