Tip: Click lines to highlight, hold ctrl/cmd to multi-select

http://codedumper.com/oleqe (24-May @ 05:50)

Syntax Highlighted Code

  1. class MemberListing(grok.View):
  2.  
  3.     def fieldNames(self):
  4.         return (f for f in IUser)
  5.  
  6.     def members(self):
  7.         pau = component.getUtility(IAuthentication)
  8.         principals = pau['principals']
  9.         roster = [ ]
  10.         for id in sorted(principals.keys()):
  11.             print id
  12.             print principals[id]
  13.             user = IUser(principals[id])        # <----- this is where the code is breaking
  14.             fields = {}
  15.             for field in IUser:
  16.                 fields[field] = getattr(user, field)
  17.             roster.append(fields)
  18.         return roster
  19.  
  20.  

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

Permalink: http://codedumper.com/oleqe