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 :  /proc/self/root/lib/python2.7/site-packages/south/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/lib/python2.7/site-packages/south/orm.pyc
�
��Rc@s>dZddlmZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZdd	lmZdd
lmZmZmZddlmZdefd
��YZiZd�Zdefd��YZdefd��YZdefd��YZdefd��YZd�ZdS(sw
South's fake ORM; lets you not have to write SQL inside migrations.
Roughly emulates the real Django ORM, to a point.
i����(tprint_functionN(tmodels(tcache(tImproperlyConfigured(tdb(task_for_it_by_nametdatetime_utils(thacks(tUnfreezeMeLatertORMBaseNotIncludedtImpossibleORMUnfreeze(tstring_typestModelsLocalscBs eZdZd�Zd�ZRS(s�
    Custom dictionary-like class to be locals();
    falls back to lowercase search for items that don't exist
    (because we store model names as lowercase).
    cCs
||_dS(N(tdata(tselfR
((s-/usr/lib/python2.7/site-packages/south/orm.pyt__init__scCs5y|j|SWntk
r0|j|j�SXdS(N(R
tKeyErrortlower(Rtkey((s-/usr/lib/python2.7/site-packages/south/orm.pyt__getitem__ s
(t__name__t
__module__t__doc__RR(((s-/usr/lib/python2.7/site-packages/south/orm.pyRs	cGs'|tkrt|�t|<nt|S(sm
    Creates a Fake Django ORM.
    This is actually a memoised constructor; the real class is _FakeORM.
    (t
_orm_cachet_FakeORM(targs((s-/usr/lib/python2.7/site-packages/south/orm.pytFakeORM*stLazyFakeORMcBs#eZdZd�Zdd�ZRS(s�
    In addition to memoising the ORM call, this function lazily generates them
    for a Migration class. Assign the result of this to (for example)
    .orm, and as soon as .orm is accessed the ORM will be created.
    cGs||_d|_dS(N(t_argstNonetorm(RR((s-/usr/lib/python2.7/site-packages/south/orm.pyR;s	cCs%|jst|j�|_n|jS(N(RRR(Rtobjttype((s-/usr/lib/python2.7/site-packages/south/orm.pyt__get__?s	N(RRRRRR!(((s-/usr/lib/python2.7/site-packages/south/orm.pyR4s	RcBs\eZdZd�Zd�Zd�Zd�Zid�Zed�Z	d�Z
d�ZRS(	so
    Simulates the Django ORM at some point in time,
    using a frozen definition on the Migration class.
    cCs(||_||_i|_y|j|_Wntk
r?dSXtj�g}x�|jj�D]�\}}d|kr�i|d<ny|jdd�\}}Wn t	k
r�|j}|}nXd|dkr�|dd}|dd=nd||f}||j|j
�<|j|j
�|||f�q`Wd}x�|r�t
|�|krct��nt
|�}g}	xg|D]_\}}}}y |j|||�|j|<Wq|tk
r�|	j||||f�q|Xq|W|	}q?W|j�x$|jj�D]}
|
jj�qWtj�dS(NtMetat.itobject_names%s.%s(tdefault_apptclsRt
models_sourcetAttributeErrorRtclear_app_cachetitemstsplitt
ValueErrorRtappendRtlenR
t
make_modelRtretry_failed_fieldstvaluest_metatget_all_field_namestunclear_app_cache(RR&tapptmodel_namestnameR
t	app_labelt
model_namet	last_sizetpostponed_model_namestmodel((s-/usr/lib/python2.7/site-packages/south/orm.pyRLsN			



	
#	 
!

cCst|jj��S(N(titerRR1(R((s-/usr/lib/python2.7/site-packages/south/orm.pyt__iter__�scCsW|jd|j�}y|j|SWn*tk
rRtd||jf��nXdS(NR#s{The model '%s' from the app '%s' is not available in this migration. (Did you use orm.ModelName, not orm['app.ModelName']?)(R%RRRR((RRtfullname((s-/usr/lib/python2.7/site-packages/south/orm.pyt__getattr__�s

cCs�d|kr$|jd�\}}nd}|j�}y|j|}Wngtk
r�y|jdd�\}}Wn!tk
r�td|��q�Xtd||f��nX|r�|jj|�dS|SdS(Nt:R#is2The model '%s' is not in appname.modelname format.sDThe model '%s' from the app '%s' is not available in this migration.i(R+RRRRR,R2tget_field_by_name(RRtfnameR<R5((s-/usr/lib/python2.7/site-packages/south/orm.pyR�s

cCs�td�tj|j�jj�D��}|jtg|jj�D]%\}}|jd�d|f^qD��|jtg|jj�D]>\}}|jd�d|kr�|jd�d|f^q���||d<d�|d<t	|d<x�|j�D]�\}}|jd�}y6||d}	x!|d	D]}
t
|	|
�}	q9WWnttfk
rlnX|	||<qyt
|�||<Wqtk
r�|d
kr�td|��q�td|�qXqWt|�}t|t�|�S(
s>Evaluates the given code in the context of the migration file.cssQ|]G\}}t|t�o<t|tj�o<t|d�s||fVqdS(R2N(t
isinstanceR t
issubclassRtModelthasattr(t.0Rtvalue((s-/usr/lib/python2.7/site-packages/south/orm.pys	<genexpr>�s	R#i����iRcSs|S(N((tx((s-/usr/lib/python2.7/site-packages/south/orm.pyt<lambda>�st_tdatetimeitSouthFieldClasss%Cannot import the required field '%s'sWARNING: Cannot import '%s'(tdicttinspectt	getmoduleR&t__dict__R*tupdateRR+RtgetattrRR(RtImportErrorR,tprintRtevaltglobals(RtcodeR5t
extra_importstfake_localsR7R<RItpartsRtpart((s-/usr/lib/python2.7/site-packages/south/orm.pyteval_in_context�s>"		<	<




c	Cs�i|d6}x�|j�D]�\}}|dkr8qn|rP|dkrPqny|j||�||<Wqttfk
r�}td||||f��qXqWtdt�|�S(	s8Makes a Meta class out of a dict of eval-able arguments.R8t_basest	_ormbasestorder_with_respect_tosACannot successfully create meta field '%s' for model '%s.%s': %s.R"(R_R`(Ra(R*R^t	NameErrorR(R,R ttuple(	RR5R<R
tstubtresultsRRYte((s-/usr/lib/python2.7/site-packages/south/orm.pyt	make_meta�s
c	Cshd|dkr�xf|ddD]V}|j�}||jkrStd|��qt|j|t�rt��qqWg|ddD]}|j|j�^q�}n6d|dkr�tt|dd�}ntjg}|j	|||d|j
dt��}i}i}t}	x�|j�D]~\}
}|
dkrQt
|�}	q'n|
dkrcq'n�|s�td|
||f��n�t|t�r�|}i}
n�t|�dkr�|dgif}nt|�d	kr9d
dj|dg|dj�D]\}}d
||f^q��}i|dd6}
ntd|
||f��y|j|||
�}Wn-ttttfk
r�||
f||
<q'X|||
<q'Wi}y tj|�}|j|d<Wntk
r�d|d<nX||d<|j|�tt|�t|�|�}|	r@t�|_t|_ nt!|j�|_|rd||_"n|S(sKMakes a Model class out of the given app name, model name and pickled data.R`R"sCannot find ORM base %sR_t_stubs.Field '%s' on model '%s.%s' has no definition.iiisSouthFieldClass(%s)s, is%s=%sRNsSField '%s' on model '%s.%s' has a weird definition length (should be 1 or 3 items).Rt_south_mock(#RRR	RDRRtmapRRFRgtgettFalseR*tboolR,R.tjoinR^RbR(tAssertionErrorRtget_appRRRSR tstrRctWhinyManagertobjectstwhiny_methodRtNoDryRunManagert_failed_fields(RR5R7R
Rtbasestmetat
failed_fieldstfieldsRdRCtparamsRYRZtntvtfieldt	more_kwdst
app_moduleR<((s-/usr/lib/python2.7/site-packages/south/orm.pyR/	st1(		8


			c

Cs�x�|jj�D]�\}}|jdd�\}}t|d�rx�|jj�D]v\}\}}y|j|||�}Wn8tttt	fk
r�}	t
d|||	f��qSX|j||�qSWqqWdS(s7Tries to re-evaluate the _failed_fields for each model.R#iRvs9Cannot successfully create field '%s' for model '%s': %s.N(RR*R+RGRvR^RbR(RoRR,tadd_to_class(
RtmodelkeyR<R5t	modelnameRCRYRZR~Rf((s-/usr/lib/python2.7/site-packages/south/orm.pyR0ns"(RRRRR>R@RR^RlRgR/R0(((s-/usr/lib/python2.7/site-packages/south/orm.pyREs	D			A	eRrcBseZdZd�ZRS(sIA fake manager that whines whenever you try to touch it. For stub models.cCstd��dS(Ns'You cannot use items from a stub model.(R((RR((s-/usr/lib/python2.7/site-packages/south/orm.pyR@�s(RRRR@(((s-/usr/lib/python2.7/site-packages/south/orm.pyRr�sRucBs eZdZd�Zd�ZRS(si
    A manager that always proxies through to the real manager,
    unless a dry run is in progress.
    cCs
||_dS(N(treal(RR�((s-/usr/lib/python2.7/site-packages/south/orm.pyR�scCs(tjrtd��nt|j|�S(Ns�You are in a dry run, and cannot access the ORM.
Wrap ORM sections in 'if not db.dry_run:', or if the whole migration is only a data migration, set no_dry_run = True on the Migration class.(Rtdry_runR(RTR�(RR7((s-/usr/lib/python2.7/site-packages/south/orm.pyR@�s	(RRRRR@(((s-/usr/lib/python2.7/site-packages/south/orm.pyRu�s	cOstd��dS(Ns$You cannot instantiate a stub model.(R,(tatkw((s-/usr/lib/python2.7/site-packages/south/orm.pyRt�s( Rt
__future__RRPt	django.dbRtdjango.db.models.loadingRtdjango.core.exceptionsRtsouth.dbRtsouth.utilsRRtsouth.hacksRtsouth.exceptionsRR	R
tsouth.utils.py3RtobjectRRRRRRrRuRt(((s-/usr/lib/python2.7/site-packages/south/orm.pyt<module>s&	
�<

https://t.me/AnonymousX5 - 2025