o
    ).h                     @   s,   d dl mZ d dlmZ dd Zdd ZdS )    )parse)	force_strc           	      C   sb   t t| \}}}}}t j|dd}t|g|t|< t jt| dd}t |||||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_dict r   X/var/www/supernova/superenvnew/lib/python3.10/site-packages/rest_framework/utils/urls.pyreplace_query_param   s
   r   c                 C   s\   t t| \}}}}}t j|dd}||d t jt| dd}t |||||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   r   r   r   remove_query_param   s
   r   N)urllibr   django.utils.encodingr   r   r   r   r   r   r   <module>   s    