§
    ¤”j*  ã                   ó8   — d Z ddlZddlmZ  G d„ d¦  «        ZdS )zT
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
é    N)Úmake_hashablec                   ó|   — e Zd ZdZdZdd„Zedd„¦   «         Zd„ Zd„ Z	d	„ Z
e
Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚNodez±
    A single internal node in the tree graph. A Node should be viewed as a
    connection (the root) with the children being either leaf nodes or other
    Node instances.
    ÚDEFAULTNFc                 óV   — |r
|dd…         ng | _         |p| j        | _        || _        dS )z@Construct a new Node. If no connector is given, use the default.N)ÚchildrenÚdefaultÚ	connectorÚnegated)Úselfr   r
   r   s       ú`/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/django/utils/tree.pyÚ__init__zNode.__init__   s3   € à'/Ð7˜   œ˜°RˆŒØ"Ð2 d¤lˆŒØˆŒˆˆó    c                 óD   — t          ||p| j        |¦  «        }| |_        |S )a  
        Create a new instance using Node() instead of __init__() as some
        subclasses, e.g. django.db.models.query_utils.Q, may implement a custom
        __init__() with a signature that conflicts with the one defined in
        Node.__init__().
        )r   r	   Ú	__class__)Úclsr   r
   r   Úobjs        r   ÚcreatezNode.create   s(   € õ �8˜YÐ5¨#¬+°wÑ?Ô?ˆØˆŒØˆ
r   c                 ót   — | j         rdnd}|| j        d                     d„ | j        D ¦   «         ¦  «        fz  S )Nz(NOT (%s: %s))z(%s: %s)z, c              3   ó4   K  — | ]}t          |¦  «        V — Œd S ©N)Ústr)Ú.0Úcs     r   ú	<genexpr>zNode.__str__.<locals>.<genexpr>*   s(   è è € Ð4SÐ4SÀµS¸±V´VÐ4SÐ4SÐ4SÐ4SÐ4SÐ4Sr   )r   r
   Újoinr   )r   Útemplates     r   Ú__str__zNode.__str__(   sC   € Ø'+¤|ÐCÐ#Ð#¸ˆØ˜4œ>¨4¯9ª9Ð4SÐ4SÀTÄ]Ð4SÑ4SÔ4SÑ+SÔ+SÐTÑTÐTr   c                 ó(   — d| j         j        ›d| ›d�S )Nú<z: ú>)r   Ú__name__©r   s    r   Ú__repr__zNode.__repr__,   s   € € Ø!œ^Ô4Ð4Ð4°d°d°dÐ;Ð;r   c                 ó`   — |                       | j        | j        ¬¦  «        }| j        |_        |S ©N)r
   r   )r   r
   r   r   )r   r   s     r   Ú__copy__zNode.__copy__/   s)   € Ø�kŠk D¤N¸D¼LˆkÑIÔIˆØ”}ˆŒØˆ
r   c                 ó†   — |                       | j        | j        ¬¦  «        }t          j        | j        |¦  «        |_        |S r&   )r   r
   r   ÚcopyÚdeepcopyr   )r   Úmemodictr   s      r   Ú__deepcopy__zNode.__deepcopy__6   s5   € Ø�kŠk D¤N¸D¼LˆkÑIÔIˆÝ”} T¤]°HÑ=Ô=ˆŒØˆ
r   c                 ó*   — t          | j        ¦  «        S )z,Return the number of children this node has.)Úlenr   r#   s    r   Ú__len__zNode.__len__;   s   € å�4”=Ñ!Ô!Ð!r   c                 ó*   — t          | j        ¦  «        S )z-Return whether or not this node has children.)Úboolr   r#   s    r   Ú__bool__zNode.__bool__?   s   € å�D”MÑ"Ô"Ð"r   c                 ó   — || j         v S )z:Return True if 'other' is a direct child of this instance.)r   ©r   Úothers     r   Ú__contains__zNode.__contains__C   s   € à˜œÐ%Ð%r   c                 ó‚   — | j         |j         k    o/| j        |j        k    o| j        |j        k    o| j        |j        k    S r   )r   r
   r   r   r4   s     r   Ú__eq__zNode.__eq__G   sH   € àŒN˜eœoÒ-ð 0Ø” %¤/Ò1ð0à” ¤Ò-ð0ð ” ¤Ò/ð		
r   c                 ón   — t          | j        | j        | j        gt	          | j        ¦  «        ¢R ¦  «        S r   )Úhashr   r
   r   r   r   r#   s    r   Ú__hash__zNode.__hash__O   sA   € Ýà”Ø”Ø”ðõ ˜tœ}Ñ-Ô-ð	ð ñ
ô 
ð 	
r   c                 óR  — | j         |k    r&|                      ¦   «         }|| _         ||g| _        |S t          |t          ¦  «        rF|j        s?|j         |k    st          |¦  «        dk    r!| j                             |j        ¦  «         | S | j                             |¦  «         |S )a»  
        Combine this tree and the data represented by data using the
        connector conn_type. The combine is done by squashing the node other
        away if possible.

        This tree (self) will never be pushed to a child node of the
        combined tree, nor will the connector or negated properties change.

        Return a node which can be used in place of data regardless if the
        node other got squashed or not.
        é   )	r
   r)   r   Ú
isinstancer   r   r.   ÚextendÚappend)r   ÚdataÚ	conn_typer   s       r   ÚaddzNode.addY   sª   € ð Œ>˜YÒ&Ð&Ø—)’)‘+”+ˆCØ&ˆDŒNØ  $˜KˆDŒMØˆKå�t�TÑ"Ô"ð	à”Lð	ð ” 9Ò,Ð,µ°D±	´	¸Q²°ð ŒM× Ò  ¤Ñ/Ô/Ð/ØˆKð ŒM× Ò  Ñ&Ô&Ð&ØˆKr   c                 ó    — | j          | _         dS )z'Negate the sense of the root connector.N)r   r#   s    r   ÚnegatezNode.negate|   s   € àœ<Ð'ˆŒˆˆr   )NNF)r"   Ú
__module__Ú__qualname__Ú__doc__r	   r   Úclassmethodr   r   r$   r'   r)   r,   r/   r2   r6   r8   r;   rC   rE   © r   r   r   r      s	  € € € € € ðð ð €Gðð ð ð ð ð	ð 	ð 	ñ „[ð	ðUð Uð Uð<ð <ð <ðð ð ð
 €Dðð ð ð
"ð "ð "ð#ð #ð #ð&ð &ð &ð
ð 
ð 
ð
ð 
ð 
ð!ð !ð !ðF(ð (ð (ð (ð (r   r   )rH   r)   Údjango.utils.hashabler   r   rJ   r   r   ú<module>rL      sh   ððð ð
 €€€à /Ð /Ð /Ð /Ð /Ð /ðs(ð s(ð s(ð s(ð s(ñ s(ô s(ð s(ð s(ð s(r   