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/options.pyc
�
r�\c@s1ddlmZddlZddlmZddlZddlmZddlmZddl	m
Z
mZddlm
Z
ddlmZmZdd	lmZdd
lmZddlmZddlmZmZmZdd
lmZmZmZmZd�Z d"Z!ed e"fd!��Y�Z#dS(#i����(tunicode_literalsN(tbisect(tsettings(t
ManyToManyRel(t	AutoFieldtFieldDoesNotExist(tOrderWrt(t
get_modelstapp_cache_ready(tsix(tcached_property(t
SortedDict(t
force_textt
smart_texttpython_2_unicode_compatible(tactivatetdeactivate_alltget_languaget
string_concatcCstjdd|�j�j�S(Nu&(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))u \1(tretsubtlowertstrip(t
class_name((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt<lambda>suverbose_nameuverbose_name_pluraludb_tableuorderinguunique_togetherupermissionsu
get_latest_byuorder_with_respect_tou	app_labelu
db_tablespaceuabstractumanageduproxyu	swappableuauto_createduindex_togetheruselect_on_savetOptionscBs�eZd&d�Zd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zee�Zd�Zee�Zed
��Zed��Zed��Zd�Zd�Zd�Zd�Zee�Zd�Zd�Zed�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$e%e%e%d�Z&e%e%e%d�Z'd�Z(e%d �Z)d!�Z*d"�Z+d#�Z,d$�Z-d%�Z.RS('cCs-gg|_|_g|_d\|_|_d|_d|_g|_g|_	g|_
t|_g|_
d||_|_d|_d|_tj|_||_d|_td|_|_t|_t|_t|_d|_d|_d|_t �|_!t|_"g|_#g|_$g|_%dS(Nu(NN(&tlocal_fieldstlocal_many_to_manytvirtual_fieldstNonet
model_nametverbose_nametverbose_name_pluraltdb_tabletorderingtunique_togethertindex_togethertFalsetselect_on_savetpermissionstobject_namet	app_labelt
get_latest_bytorder_with_respect_toRtDEFAULT_TABLESPACEt
db_tablespacetmetatpkthas_auto_fieldt
auto_fieldtabstracttTruetmanagedtproxytproxy_for_modeltconcrete_modelt	swappableRtparentstauto_createdtabstract_managerstconcrete_managerstrelated_fkey_lookups(tselfR.R)((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt__init__s8																					cCs?ddlm}ddlm}||_||_tjdd|j�t	j
k|_|j|_
|j
j�|_t|j
�|_|jr�|jjj�}x-|jjD]}|jd�r�||=q�q�WxgtD]_}||krt|||j|��q�t|j|�r�t||t|j|��q�q�W|jd|j�}|r|t|dttf�r||f}n||_|jdkr�t!|jd	�|_n|ikr�t"d
dj#|j$����q�nt!|jd	�|_|`|j%s;d|j&|jf|_%||j%|j'j(��|_%ndS(
Ni����(t
connection(t
truncate_nameu	\.models$uu_uunique_togetheriusu)'class Meta' got invalid attribute(s): %su,u%s_%s()t	django.dbR@tdjango.db.backends.utilRAt_metatmodelRRt
__module__RtINSTALLED_APPSt	installedt__name__R(RRtget_verbose_nameRR.t__dict__tcopyt
startswitht
DEFAULT_NAMEStsetattrtpopthasattrtgetattrR#t
isinstancettupletlistR RRt	TypeErrortjointkeysR!R)topstmax_name_length(R>tclstnameR@RAt
meta_attrst	attr_nametut((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytcontribute_to_classJs>		$	
# 	%	cCstjdtdd�|jS(uY
        This property has been deprecated in favor of `model_name`. refs #19689
        u>Options.module_name has been deprecated in favor of model_namet
stackleveli(twarningstwarntPendingDeprecationWarningR(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytmodule_name~s
cCs|jr=|j|j�|_d|_|jdt��n	d|_|jdkr�|jr�tt	j
|j��}g|jD]}|j|jkr�|^q�}|r�|d}nt
|_|j|�q�tdddt
dt
�}|jd|�ndS(	Nu_orderiRuIDtprimary_keyR:uid(u_order(R+t	get_fieldR"tadd_to_classRRR/R9tnextR	t
itervaluesRR\R3Rftsetup_pkR(R>REtfieldtfldtalready_createdtauto((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt_prepare�s 				.
		cCs|jrUt|jt�rU|jjt|j|�|�t|d�r�|`q�n�|jjt|j|�|�|j	|�t|d�r�|`
|`y
|`Wnt
k
r�nXy
|`Wnt
k
r�nXy
|`Wq�t
k
r�q�Xnt|d�r|`ndS(Nu
_m2m_cacheu_field_cacheu	_name_map(trelRSRRtinsertRRQt
_m2m_cacheRRkt_field_cachet_field_name_cachetfieldstAttributeErrortconcrete_fieldstlocal_concrete_fieldst	_name_map(R>Rl((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt	add_field�s.






cCs|jj|�dS(N(Rtappend(R>Rl((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytadd_virtual_field�scCs,|jr(|jr(||_t|_ndS(N(R/RfR%t	serialize(R>Rl((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRk�s	cCs|jj|j�S(uf
        Returns the index of the primary key field in the self.concrete_fields
        list.
        (RxtindexR/(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytpk_index�scCs+|jj|_||_|jj|_dS(ud
        Does the internal setup so that the current model is a proxy for
        "target".
        N(RDR/R6R!(R>ttarget((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytsetup_proxy�s	cCsd|jS(Nu<Options for %s>(R((R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt__repr__�scCs dt|j�t|j�fS(Nu%s.%s(R
R)R(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt__str__�scCs-t�}t�t|j�}t|�|S(u�
        There are a few places where the untranslated verbose name is needed
        (so that we get the same value regardless of currently active
        locale).
        (RRRRR(R>tlangtraw((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytverbose_name_raw�s
	
cCs�|jr�d|j|jf}tt|jd�}|r�y|jd�\}}Wntk
rg|SXd||j�fd|fkr�|Sq�ndS(u!
        Has this model been swapped out for another? If so, return the model
        name of the replacement; otherwise, return None.

        For historical reasons, model name lookups using get_model() are
        case insensitive, so we make sure we are case insensitive here.
        u%s.%su.N(	R8R)RRRRRtsplitt
ValueErrorR(R>tmodel_labeltswapped_fort
swapped_labeltswapped_object((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt_swapped�s	
"
cCs0y|jWntk
r(|j�nX|jS(u

        The getter for self.fields. This returns the list of field objects
        available to this model (including through parent models).

        Callers are not permitted to modify this list, since it's a reference
        to this instance (not a copy).
        (RuRwt_fill_fields_cache(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRv
s
	
cCs)g|jD]}|jdk	r
|^q
S(N(RvtcolumnR(R>tf((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRxscCs)g|jD]}|jdk	r
|^q
S(N(RR�R(R>R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRyscCs0y|jWntk
r(|j�nX|jS(u�
        Returns a sequence of (field, model) pairs for all fields. The "model"
        element is None for fields on the current model. Mostly of use when
        constructing queries so that we know which model a field belongs to.
        (RtRwR�(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_fields_with_model!s

cCs8g|j�D]'\}}|jdk	r
||f^q
S(N(R�R�R(R>RlRE((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_concrete_fields_with_model-scCs�g}x`|jD]U}xL|jj�D];\}}|rN|j||f�q&|j||f�q&WqW|jg|jD]}|df^qy�t|�|_g|D]\}}|^q�|_	dS(N(
R9RDR�R|textendRRRTRtRu(R>tcachetparentRlRER�txt_((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�1s)cCs6y|jWntk
r(|j�nXt|j�S(N(RsRwt_fill_m2m_cacheRU(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt
_many_to_many=s

cCs?y|jWntk
r(|j�nXttj|j��S(uF
        The many-to-many version of get_fields_with_model().
        (RsRwR�RUR	t	iteritems(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_m2m_with_modelEs

cCs�t�}xN|jD]C}x:|jj�D])\}}|rH|||<q)|||<q)WqWx|jD]}d||<qdW||_dS(N(RR9RDR�RRRs(R>R�R�RlRE((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�Os	
cCs`|r|j|jn|j}x!|D]}|j|kr&|Sq&Wtd|j|f��dS(uY
        Returns the requested field by name. Raises FieldDoesNotExist on error.
        u%s has no field named %rN(Rvtmany_to_manyR\RR((R>R\R�t	to_searchR�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRg[s

cCsiy8y|j|SWn"tk
r6|j�}||SXWn*tk
rdtd|j|f��nXdS(u6
        Returns the (field_object, model, direct, m2m), where field_object is
        the Field instance for the given name, model is the model containing
        this field (None for local fields), direct is True if the field exists
        on this model, and m2m is True for many-to-many relations. When
        'direct' is False, 'field_object' is the corresponding RelatedObject
        for this field (since the field doesn't have an instance associated
        with it).

        Uses a cache internally, so after the first access, this is very fast.
        u%s has no field named %rN(RzRwt
init_name_maptKeyErrorRR((R>R\R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_field_by_namees


cCsey
|j}Wntk
r,|j�}nXt|j��}g|D]}|jd�sF|^qFS(u

        Returns a list of all field names that are possible for this model
        (including reverse relation names). This is used for pretty printing
        debugging output (a list of choices), so any internal-only field names
        are not included.
        u+(RzRwR�tsortedRXtendswith(R>R�tnamestval((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_all_field_names{s

cCs`i}x9|j�D]+\}}||ttf||jj�<qWx9|j�D]+\}}||ttf||jj�<qOWx3|j�D]%\}}||ttf||j<q�Wx3|j�D]%\}}||ttf||j<q�WxZ|j	D]O}t
|d�r�|j|j|jkr'dn|jttf||j<q�q�Wt�r\||_n|S(uE
        Initialises the field name -> field object mapping.
        urelatedN(t&get_all_related_m2m_objects_with_modelR%R3Rltrelated_query_namet"get_all_related_objects_with_modelR�R\R�RRQtrelatedRERRRz(R>R�R�RE((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR��s##>	cCs!tjdtdd�d|jS(u�
        This method has been deprecated in favor of
        `django.contrib.auth.get_permission_codename`. refs #20642
        uk`Options.get_add_permission` has been deprecated in favor of `django.contrib.auth.get_permission_codename`.Raiuadd_%s(RbRcRdR(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_add_permission�s
cCs!tjdtdd�d|jS(u�
        This method has been deprecated in favor of
        `django.contrib.auth.get_permission_codename`. refs #20642
        un`Options.get_change_permission` has been deprecated in favor of `django.contrib.auth.get_permission_codename`.Raiu	change_%s(RbRcRdR(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_change_permission�s
cCs!tjdtdd�d|jS(u�
        This method has been deprecated in favor of
        `django.contrib.auth.get_permission_codename`. refs #20642
        un`Options.get_delete_permission` has been deprecated in favor of `django.contrib.auth.get_permission_codename`.Raiu	delete_%s(RbRcRdR(R>((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_delete_permission�s
cCs5g|jd|d|d|�D]\}}|^qS(Nt
local_onlytinclude_hiddentinclude_proxy_eq(R�(R>R�R�R�tktv((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pytget_all_related_objects�scs�y|jWntk
r(|j�nXg}|rH|jd��n|sa|jd��n|rp|jn|j}g|j�D](�t�fd�|D��r��^q�S(un
        Returns a list of (related-object, model) pairs. Similar to
        get_fields_with_model().
        cSs|S(N((R�R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�scSs|jjj�S(N(RlRqt	is_hidden(R�R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�sc3s|]}|��VqdS(N((t.0tp(tt(s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pys	<genexpr>�s(t_related_objects_cacheRwt_fill_related_objects_cacheR|t_related_objects_proxy_cachetitemstall(R>R�R�R�t
predicatesR�((R�s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR��s
	c	Cs�t�}|j�}x�|jD]}xv|jjdt�D]_\}}|jjdksh|jjj	r}|j
|kr}q;n|s�|||<q;|||<q;WqW|j�}x�tdtdt
�D]�}|jjs�x�|jjD]�}|jr�t|jjtj�r�|jr�||jjjkrFd||j<d||j<qt|j|jjjjkrtd||j<qtq�q�Wq�q�W||_||_dS(NR�itinclude_auto_createdtonly_installed(Rtget_parent_listR9RDR�R3Rltcreation_counterRqtparent_linkRERLRR%tswappedRRSttoR	tstring_typestgenerate_reverse_relationRR�R7R�R�(	R>R�tparent_listR�tobjREtproxy_cachetklassR�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR��s*	"0
+
	cCsfy
|j}Wntk
r,|j�}nX|r\g|j�D]\}}|s@|^q@St|�S(N(t_related_many_to_many_cacheRwt _fill_related_many_to_many_cacheR�RU(R>R�R�R�R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt$get_all_related_many_to_many_objects�s

)cCs@y
|j}Wntk
r,|j�}nXttj|��S(ur
        Returns a list of (related-m2m-object, model) pairs. Similar to
        get_fields_with_model().
        (R�RwR�RUR	R�(R>R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR��s


cCs-t�}|j�}xu|jD]j}xa|jj�D]P\}}|jjdkrh|j|krhq5n|s{|||<q5|||<q5WqWx�tdt	�D]s}|jj
s�x^|jjD]M}|jr�t
|jjtj�r�||jjjkr�d||j<q�q�Wq�q�Wt�r)||_n|S(NiR�(RR�R9RDR�RlR�RERR%R�RRqRSR�R	R�RR�RR�(R>R�R�R�R�RER�R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�	s&	!
		cCsg|js
dS||jkr#|gSx=|jD]2}|jj|�}|r-|jd|�|Sq-WdS(u�
        Returns a list of parent classes leading to 'model' (order from closet
        to most distant ancestor). This has to handle the case were 'model' is
        a granparent or even more distant relation.
        iN(R9RRDtget_base_chainRr(R>RER�tres((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�s	cCsDt�}x4|jD])}|j|�|j|jj��qW|S(u�
        Returns a list of all the ancestor of this model as a list. Useful for
        determining if something is an ancestor, regardless of lineage.
        (tsetR9taddtupdateRDR�(R>tresultR�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�0s
	
cCs[||jkr|j|Sx:|jD]/}|jj|�}|r$|j|pR|Sq$WdS(u^
        Returns the field on the current model which points to the given
        "ancestor". This is possible an indirect link (a pointer to a parent
        model, which points, eventually, to the ancestor). Used when
        constructing table joins for model inheritance.

        Returns None if the model isn't an ancestor of this one.
        N(R9RDtget_ancestor_link(R>tancestorR�R�((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyR�;s	N(/RIRFRR?R`tpropertyReRpR{R}RkR�R�R�R�R�R�R�R
RvRxRyR�R�R�R�R�R�R�R3RgR�R�R�R�R�R�R%R�R�R�R�R�R�R�R�R�(((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyRsX,	4
		#														
	
												(uverbose_nameuverbose_name_pluraludb_tableuorderinguunique_togetherupermissionsu
get_latest_byuorder_with_respect_tou	app_labelu
db_tablespaceuabstractumanageduproxyu	swappableuauto_createduindex_togetheruselect_on_save($t
__future__RRRRbtdjango.confRtdjango.db.models.fields.relatedRtdjango.db.models.fieldsRRtdjango.db.models.fields.proxyRtdjango.db.models.loadingRRtdjango.utilsR	tdjango.utils.functionalR
tdjango.utils.datastructuresRtdjango.utils.encodingRR
Rtdjango.utils.translationRRRRRJRNtobjectR(((s:/tmp/pip-install-XxeQeY/django/django/db/models/options.pyt<module>s*"	

https://t.me/AnonymousX5 - 2025