#NEWLINE# def __init__( self , roles_qs , roles_to_users , * args , **kwargs ) : #NEWLINE# #INDENT# '\n        @param roles_qs: queryset of allowed roles\n        @param roles_to_users: dict mapping each role in roles_qs to a\n            set of users\n        ' #NEWLINE# super ( SelectRoleForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# self . fields [ 'requested_role' ] . queryset = roles_qs #NEWLINE# ids = [ ] #NEWLINE# for users in roles_to_users . values ( ) : #NEWLINE# #INDENT# ids . extend ( list ( users . values_list ( 'pk' , flat = True ) ) ) #NEWLINE# #UNINDENT# self . fields [ 'giver' ] . queryset = User . objects . filter ( pk__in = roles_to_users ) #NEWLINE# self . roles_to_users = roles_to_users