def group_update_member(group_id, users_id_list):
 group = get_object(UserGroup, id=group_id)
 if group:
  group.user_set.clear()
  for user_id in users_id_list:
   user = get_object(UserGroup, id=user_id)
   if isinstance(user, UserGroup):
    group.user_set.add(user)

def group_update_member ( group_id , users_id_list ) : group = get_object ( UserGroup , id = group_id ) if group : group . user_set . clear ( ) for user_id in users_id_list : user = get_object ( UserGroup , id = user_id ) if isinstance ( user , UserGroup ) : group . user_set . add ( user )
user group update member .