'Get a list of members of a group
@param group_id: the group record ID
@param for_pe: show only group members for this PE
@return: a list of the user_ids for members of a group'

def s3_group_members(self, group_id, for_pe=[]):

    mtable = self.settings.table_membership
    query = ((mtable.deleted != True) & (mtable.group_id == group_id))
    if (for_pe is None):
        query &= (mtable.pe_id == None)
    elif for_pe:
        query &= (mtable.pe_id == for_pe)
    members = current.db(query).select(mtable.user_id)
    return [m.user_id for m in members]
