
    Nwg                     (    d dl mZ d dlmZ d Zd Zy)    )parse)	force_strc                 8   t        j                  t        |             \  }}}}}t        j                  |d      }t        |      g|t        |      <   t        j                  t        |j                               d      }t        j                  |||||f      S )z
    Given a URL and a key/val pair, set or replace an item in the query
    parameters of the URL, and return the new URL.
    Tkeep_blank_valuesdoseq)r   urlsplitr   parse_qs	urlencodesorteditems
urlunsplit)	urlkeyvalschemenetlocpathqueryfragment
query_dicts	            P/var/www/horilla/myenv/lib/python3.12/site-packages/rest_framework/utils/urls.pyreplace_query_paramr      s    
 /4nnYs^.L+VVT5(>J"+C.!1Jy~OOF:#3#3#56dCEVVT5(CDD    c                 ,   t        j                  t        |             \  }}}}}t        j                  |d      }|j	                  |d       t        j
                  t        |j                               d      }t        j                  |||||f      S )zx
    Given a URL and a key/val pair, remove an item in the query
    parameters of the URL, and return the new URL.
    Tr   Nr   )	r   r
   r   r   popr   r   r   r   )r   r   r   r   r   r   r   r   s           r   remove_query_paramr      sy    
 /4nnYs^.L+VVT5(>JNN3OOF:#3#3#56dCEVVT5(CDDr   N)urllibr   django.utils.encodingr   r   r    r   r   <module>r"      s     +	E	Er   