'Adds a query parameter with the given name and value -- but prevents
duplication.'

def merge_query_param(self, name, value):

    params = self.query.multi_dict
    if (name in params):
        for (param, defaults) in params.items():
            if (param == name):
                if ((value not in defaults) and (value not in (None, [None]))):
                    defaults.append(value)
    else:
        params[name] = value
    return self.without_query().set_query_params(self.clean_params(params))
