File: //usr/local/CyberPanel/lib64/python3.10/site-packages/django/utils/__pycache__/tree.cpython-310.pyc
o
�h* � @ s* d Z ddlZddlmZ G dd� d�ZdS )zT
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
� N)�
make_hashablec @ s� e Zd ZdZdZddd�Zeddd��Zd d
� Zdd� Z d
d� Z
e
Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zdd� ZdS ) �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 C s, |r|dd� ng | _ |p| j| _|| _dS )z@Construct a new Node. If no connector is given, use the default.N)�children�default� connector�negated)�selfr r r � r
�G/usr/local/CyberPanel/lib/python3.10/site-packages/django/utils/tree.py�__init__ s
z
Node.__init__c C s 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 �objr
r
r �create s zNode.createc C s. | j rdnd}|| jd�dd� | jD ��f S )Nz(NOT (%s: %s))z(%s: %s)z, c s s � | ]}t |�V qd S �N)�str)�.0�cr
r
r � <genexpr>* s � zNode.__str__.<locals>.<genexpr>)r r �joinr )r �templater
r
r �__str__( s zNode.__str__c C s d| j j| f S )Nz<%s: %s>)r
�__name__�r r
r
r �__repr__, s z
Node.__repr__c C s | j | j| jd�}| j|_|S �N)r r )r r r r )r r r
r
r �__copy__/ s z
Node.__copy__c C s&