def _update_query(self, changelist, include=None, exclude=None):
    selected_list = self.value_as_list()
    if (include and (include not in selected_list)):
        selected_list.append(include)
    if (exclude and (exclude in selected_list)):
        selected_list.remove(exclude)
    if selected_list:
        compiled_selection = ','.join(selected_list)
        return changelist.get_query_string({self.parameter_name: compiled_selection})
    else:
        return changelist.get_query_string(remove=[self.parameter_name])
def _update_query(self, changelist, include=None, exclude=None):
    selected_list = self.value_as_list()
    if (include and (include not in selected_list)):
        selected_list.append(include)
    if (exclude and (exclude in selected_list)):
        selected_list.remove(exclude)
    if selected_list:
        compiled_selection = ','.join(selected_list)
        return changelist.get_query_string({self.parameter_name: compiled_selection})
    else:
        return changelist.get_query_string(remove=[self.parameter_name])