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/loading.pyc
�
r�\c@s?dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lZdd	lZdd	lZd
ddd
dddfZdefd��YZdefd��YZe�ZejZejZejZejZejZejZejZejZej Z d	S(s?Utilities for loading models and the modules that contain them.i����(tsettings(tImproperlyConfigured(t
SortedDict(t
import_module(tmodule_has_submodule(tupath(tsixNtget_appstget_appt
get_modelst	get_modeltregister_modelstload_apptapp_cache_readytUnavailableAppcBseZRS((t__name__t
__module__(((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyRstAppCachecBs�eZdZede�dide�didede�dgdd	d
idd�
Zd�Z	d
�Z
d�Zed�Zd�Z
d�Zd�Zed�Zd�Zdeeeed�Zeed�Zd�Zd�Zd�ZRS(s�
    A cache that stores installed applications and their models. Used to
    provide reverse-relations and for app introspection (e.g. admin).
    t	app_storet
app_labelst
app_modelst
app_errorstloadedthandledt	postponedt
nesting_levelit_get_models_cachetavailable_appscCs|j|_dS(N(t_AppCache__shared_statet__dict__(tself((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt__init__3scCs�|jr
dStj�z�|jr'dSx6tjD]+}||jkrLq1n|j|t�q1W|js�x|j	D]}|j|�qsWt|_nWdtj
�XdS(s�
        Fill in all the cache information. This method is threadsafe, in the
        sense that every caller will see the same state upon return, and if the
        cache is already initialised, it does no work.
        N(Rtimptacquire_lockRtINSTALLED_APPSRRtTrueRRtrelease_lock(Rtapp_name((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt	_populate6s	
		cCs|jjd�dS(s<
        Return app_label for given models module.

        t.i����(Rtsplit(Rtapp_mod((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt
_label_forSscCs�|jj|�|jd7_t|�}ytd|�}WnPtk
r�|jd8_t|d�sqdS|r�|jj|�dS�nX|jd8_||j	kr�t
|j	�|j	|<||j|j|�<n|S(sm
        Loads the app with the provided fully qualified name, and returns the
        model module.
        is	%s.modelstmodelsN(
RtaddRRtImportErrorRtNoneRtappendRtlenRR*(RR%tcan_postponet
app_moduleR+((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyRZs$
	cCs|jS(s�
        Returns true if the model cache is fully populated.

        Useful for code that wants to cache the results of get_models() for
        themselves once it is safe to do so.
        (R(R((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyR
~scCs�|j�|jj�}|jdk	r`g|D](}|j|d�|jkr/|^q/}nt|dd��}g|D]}|d^q|S(sN
        Returns a list of all installed modules that contain models.
        itkeycSs|dS(Ni((telt((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt<lambda>�sN(R&RtitemsRR.R*tsorted(RtappsR4((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyR�s

+cCs||j�g}xe|j�D]W}t|d�r^|jg|jD]}t|�^qB�q|jt|j��qW|S(s�
        Returns a list of paths to all installed apps.

        Useful for discovering files at conventional locations inside apps
        (static files, templates, etc.)
        t__path__(R&RthasattrtextendR9RR/t__file__(Rt	app_pathstapptpath((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt
get_app_paths�s
,cCs�|j�tj�z�x�tjD]�}||jd�dkr!|j|t�}|dkrx|rxt	d|��n|j
dk	r�||j
kr�td|��n|Sq!Wt	d|��Wdtj�XdS(s

        Returns the module containing the models for the given app_label.

        Returns None if the app has no models in it and emptyOK is True.

        Raises UnavailableApp when set_available_apps() in in effect and
        doesn't include app_label.
        R'i����s0App with label %s is missing a models.py module.s"App with label %s isn't available.s$App with label %s could not be foundN(
R&R R!RR"R(RtFalseR.RRRR$(Rt	app_labeltemptyOKR%tmod((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyR�s	

cCs|j�|jS(s:Returns the map of known problems with the INSTALLED_APPS.(R&R(R((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pytget_app_errors�s
cs�|��|�f}d}y[|j|}|jdk	rq|rqg|D]!}|jj|jkrG|^qG}n|SWntk
r�nX|j�|r�||jkr�|jj	|j
|�t��g}	q+g}	nR|rgtj
|j�D]}
|jj	|
t��^q�}	ntj|j�}	g}x7|	D]/}|j���fd�|j�D��q8W||j|<|jdk	r�|r�g|D]!}|jj|jkr�|^q�}n|S(sr
        Given a module containing models, returns a list of the models.
        Otherwise returns a list of all installed models.

        By default, auto-created models (i.e., m2m models without an
        explicit intermediate table) are not included. However, if you
        specify include_auto_created=True, they will be.

        By default, models created to satisfy deferred attribute
        queries are *not* included in the list of models. However, if
        you specify include_deferred, they will be.

        By default, models that aren't part of installed apps will *not*
        be included in the list of models. However, if you specify
        only_installed=False, they will be.

        By default, models that have been swapped out will *not* be
        included in the list of models. However, if you specify
        include_swapped, they will be.
        c3sK|]A}|js�r|jjs,�r|jjs?�r|VqdS(N(t	_deferredt_metatauto_createdtswapped(t.0tmodel(tinclude_auto_createdtinclude_deferredtinclude_swapped(s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pys	<genexpr>�sN(R.RRRGRBtKeyErrorR&RRtgetR*RRtiterkeysRt
itervaluesR;tvalues(RR)RLRMtonly_installedRNt	cache_keyt
model_listtmtapp_listRBR>((RLRMRNs:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyR	�s:

$

	7
'

$cCs�|r|j�n|r,||jkr,dS|jdk	rc|rc||jkrctd|��ny|j||j�SWntk
r�dSXdS(s
        Returns the model matching the given app_label and case-insensitive
        model_name.

        Returns None if no model is found.

        Raises UnavailableApp when set_available_apps() in in effect and
        doesn't include app_label.
        s"App with label %s isn't available.N(R&RR.RRRtlowerRO(RRBt
model_namet
seed_cacheRT((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyR
s

cGs�x�|D]�}|jj}|jj|t��}||kr�tjjtt	j
|jj��}tjjtt	j
||jj��}tjj
|�dtjj
|�dkr�qq�n|||<qW|jj�dS(sB
        Register a set of models as belonging to an app.
        iN(RGRZRt
setdefaultRtosR?tabspathRtsystmodulesRR<tsplitextRtclear(RRBR+RKRZt
model_dicttfname1tfname2((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyRs
%),	cCspt|�jttj��sSt|�ttj�}tddj|���ntd�|D��|_dS(Ns=Available apps isn't a subset of installed apps, extra apps: s, css%|]}|jdd�dVqdS(R'ii����N(trsplit(RJR>((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pys	<genexpr>6s(tsettissubsetRR"t
ValueErrortjoinR(Rt	availabletextra((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pytset_available_apps1s
cCs
d|_dS(N(R.R(R((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pytunset_available_apps8sN(RRt__doc__tdictRRARgR.RRR&R*RR
RR@RRER#R	R
RRmRn(((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyRs8							$					;		(!Rotdjango.confRtdjango.core.exceptionsRtdjango.utils.datastructuresRtdjango.utils.importlibRtdjango.utils.module_loadingRtdjango.utils._osRtdjango.utilsRR R_R]t__all__t	ExceptionRtobjectRtcacheRR@RRER	R
RRR
(((s:/tmp/pip-install-XxeQeY/django/django/db/models/loading.pyt<module>s2�'									

https://t.me/AnonymousX5 - 2025