
    P}bg                     P   d dl Z d dlmZ d dlmZmZmZmZ d dlm	Z	 ddl
mZ g dZ e            Z G d d	          Z G d
 deee          Z G d de          Z G d de          Z G d de          Z G d de          Z G d deee          Z G d deee          ZdS )    N)
ArrayField)	AggregateBooleanField	JSONFieldValue)RemovedInDjango50Warning   )OrderableAggMixin)ArrayAggBitAndBitOrBoolAndBoolOrJSONBAgg	StringAggc                   *     e Zd Zed fd
Zd Z xZS )DeprecatedConvertValueMixin)defaultc                r    |t           u r
d }d| _        nd| _         t                      j        |d|i| d S )NFTr   )NOT_PROVIDED_default_providedsuper__init__)selfr   expressionsextra	__class__s       }/home/e360mart.nyusoft.in/public_html/e360mart_env/lib/python3.11/site-packages/django/contrib/postgres/aggregates/general.pyr   z$DeprecatedConvertValueMixin.__init__   sM    l""G%*D""%)D"+@w@%@@@@@    c                 f    |.| j         s't          j        | j        t                     | j        S |S )N)category)r   warningswarndeprecation_msgr   deprecation_value)r   value
expression
connections       r   convert_valuez)DeprecatedConvertValueMixin.convert_value   s5    =!7=M$.9QRRRR))r   )__name__
__module____qualname__r   r   r)   __classcell__r   s   @r   r   r      s[        -9 A A A A A A A      r   r   c                   L    e Zd ZdZdZdZ ed           ZdZed             Z	dS )r   	ARRAY_AGG6%(function)s(%(distinct)s%(expressions)s %(ordering)s)Tc                     g S N r   s    r   <lambda>zArrayAgg.<lambda>(   s    b r   zIn Django 5.0, ArrayAgg() will return None instead of an empty list if there are no rows. Pass default=None to opt into the new behavior and silence this warning or default=Value([]) to keep the previous behavior.c                 @    t          | j        d         j                  S )Nr   )r   source_expressionsoutput_fieldr5   s    r   r9   zArrayAgg.output_field0   s    $1!4ABBBr   N)
r*   r+   r,   functiontemplateallow_distinctpropertyr%   r$   r9   r4   r   r   r   r   "   sa        HGHN !11	  C C XC C Cr   r   c                       e Zd ZdZdS )r   BIT_ANDNr*   r+   r,   r:   r4   r   r   r   r   5   s        HHHr   r   c                       e Zd ZdZdS )r   BIT_ORNr@   r4   r   r   r   r   9   s        HHHr   r   c                   &    e Zd ZdZ e            ZdS )r   BOOL_ANDNr*   r+   r,   r:   r   r9   r4   r   r   r   r   =   s        H<>>LLLr   r   c                   &    e Zd ZdZ e            ZdS )r   BOOL_ORNrE   r4   r   r   r   r   B   s        H<>>LLLr   r   c                   6    e Zd ZdZdZdZ e            ZdZdZ	dS )r   	JSONB_AGGr1   Tz[]zIn Django 5.0, JSONBAgg() will return None instead of an empty list if there are no rows. Pass default=None to opt into the new behavior and silence this warning or default=Value('[]') to keep the previous behavior.N)
r*   r+   r,   r:   r;   r<   r   r9   r%   r$   r4   r   r   r   r   G   s:        HGHN9;;L 	 OOr   r   c                   2     e Zd ZdZdZdZdZdZ fdZ xZ	S )r   
STRING_AGGr1   T zIn Django 5.0, StringAgg() will return None instead of an empty string if there are no rows. Pass default=None to opt into the new behavior and silence this warning or default=Value('') to keep the previous behavior.c                 v    t          t          |                    } t                      j        ||fi | d S r3   )r   strr   r   )r   r'   	delimiterr   delimiter_exprr   s        r   r   zStringAgg.__init__e   s=    s9~~..^==u=====r   )
r*   r+   r,   r:   r;   r<   r%   r$   r   r-   r.   s   @r   r   r   W   sY        HGHN 	 > > > > > > > > >r   r   )r"   django.contrib.postgres.fieldsr   django.db.modelsr   r   r   r   django.utils.deprecationr   mixinsr
   __all__objectr   r   r   r   r   r   r   r   r   r4   r   r   <module>rW      s    5 5 5 5 5 5 F F F F F F F F F F F F = = = = = = % % % % % %   vxx        C C C C C*,=y C C C&    Y       I   " " " " "i " " "
" " " " "Y " " "
    *,=y    > > > > >+->	 > > > > >r   