'Cleans query parameters that don\'t have a value to not freak out
urllib\'s quoting and Django\'s form system.'

def clean_params(self, params):

    clean_params = {}
    for (param, default) in params.items():
        if isinstance(default, (list, tuple)):
            default = [(item or '') for item in default]
            if (len(default) == 1):
                default = default[0]
        if isinstance(default, basestring):
            default = default.strip()
        if (param and default):
            clean_params[param] = default
    return clean_params
