'Serialize as a URL for a GET request.'

def to_url(self):

    base_url = urlparse.urlparse(self.url)
    try:
        query = base_url.query
    except AttributeError:
        query = base_url[4]
    query = parse_qs(query)
    for (k, v) in self.items():
        query.setdefault(k, []).append(v)
    try:
        scheme = base_url.scheme
        netloc = base_url.netloc
        path = base_url.path
        params = base_url.params
        fragment = base_url.fragment
    except AttributeError:
        scheme = base_url[0]
        netloc = base_url[1]
        path = base_url[2]
        params = base_url[3]
        fragment = base_url[5]
    url = (scheme, netloc, path, params, urllib.urlencode(query, True), fragment)
    return urlparse.urlunparse(url)
