403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/db/models/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/db/models/__pycache__/options.cpython-311.pyc
�

�|�e�����ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
ddlmZmZmZmZddlmZdd	lmZmZdd
lmZddlmZddlmZmZdd
lm Z e!��Z"dZ#dZ$dZ%d�Z&d�Z'Gd�d��Z(dS)�N)�defaultdict)�apps)�settings)�FieldDoesNotExist�ImproperlyConfigured)�connections)�	AutoField�Manager�OrderWrt�UniqueConstraint)�PathInfo)�
ImmutableList�
OrderedSet)�cached_property)�
import_string)�camel_case_to_spaces�format_lazy)�override�zyThe return type of '%s' should never be mutated. If you want to manipulate this list for your own use, make a copy first.)�verbose_name�verbose_name_plural�db_table�ordering�unique_together�permissions�
get_latest_by�order_with_respect_to�	app_label�
db_tablespace�abstract�managed�proxy�	swappable�auto_created�index_togetherr�default_permissions�select_on_save�default_related_name�required_db_features�required_db_vendor�base_manager_name�default_manager_name�indexes�constraintsc��	|sdSt|ttf��st�|d}t|ttf��s|f}td�|D����S#t$r|cYSwxYw)z�
    option_together can be either a tuple of tuples, or a single
    tuple of two strings. Normalize it to a tuple of tuples, so that
    calling code can uniformly expect that.
    rrc3�4K�|]}t|��V��dS�N)�tuple)�.0�ots  �:/usr/lib/python3/dist-packages/django/db/models/options.py�	<genexpr>z%normalize_together.<locals>.<genexpr>5s(����9�9�2�U�2�Y�Y�9�9�9�9�9�9�)�
isinstancer2�list�	TypeError)�option_together�
first_elements  r5�normalize_togetherr=&s���
��	��2��/�E�4�=�9�9�	��O�'��*�
��-�%���7�7�	1�.�0�O��9�9��9�9�9�9�9�9�������������s�A)�A"A)�)A8�7A8c�4�t|t|z���S)N)�warning)r�IMMUTABLE_WARNING)�name�datas  r5�make_immutable_fields_listrC<s����'8�4�'?�@�@�@�@r7c��eZdZhd�Zhd�ZeZd1d�Zed���Z	ed���Z
ed���Zed���Zd	�Z
d
�Zd�Zd�Zd
�Zd2d�Zd�Zd�Zd�Zd�Zd�Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Z ed���Z!ed���Z"ed���Z#ed ���Z$ed!���Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,ed)���Z-d3d+�Z.d4d,�Z/		d5d-�Z0ed.���Z1ed/���Z2ed0���Z3dS)6�Options>	�fields�managers�base_manager�managers_map�many_to_many�concrete_fields�default_manager�_forward_fields_map�local_concrete_fields>�
fields_map�_relation_tree�related_objectsNc�b�i|_g|_g|_g|_g|_d|_d|_d|_d|_d|_	d|_
g|_d|_g|_
g|_g|_g|_d|_d|_g|_d|_||_d|_d|_t0j|_g|_d|_||_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%i|_&d|_'g|_(|j)|_*d|_+dS)N�F)�add�change�delete�viewT),�_get_fields_cache�local_fields�local_many_to_many�private_fields�local_managersr+r,�
model_namerrrr�_ordering_clashr-r.rr%r'r&r�object_namerrrr�DEFAULT_TABLESPACErr)r*�meta�pk�
auto_fieldr r!r"�proxy_for_model�concrete_modelr#�parentsr$�related_fkey_lookups�default_appsrr()�selfrars   r5�__init__zOptions.__init__JsP��!#������"$��� ��� ���!%���$(��!���� ���#'�� ���
���
�$���������!��� ���#���#F�� �������"���!���%)��"�%�8���$&��!�"&�����	���������
������
� $���#���������!���%'��!��%��	�$(��!�!�!r7c�$�|j�d|j��S�N�.)rr_�ris r5�labelz
Options.label�s���.�.�.�$�*:�*:�;�;r7c�$�|j�d|j��Srl)rr]rns r5�label_lowerzOptions.label_lower�s���.�.�.�$�/�/�:�:r7c�J�|jj�|j��Sr1)r�app_configs�getrrns r5�
app_configzOptions.app_config�s���y�$�(�(���8�8�8r7c��|jduSr1)rurns r5�	installedzOptions.installed�s����d�*�*r7c	�P�ddlm}ddlm}||_||_|j|_|j���|_	t|j��|_i|_|j
�r�|j
j���}|j
jD]}|�d��r||=�t"D]�}||vr=t%|||�|����t)||��|j|<�Ct+|j
|��r<t%||t)|j
|����t)||��|j|<��t-|j��|_t-|j��|_t)|jdd��s;dD]8}t)||g��}t%|||�||�����9|j�t7d|j��|_t9|jo|j��|_|ikr%tAd	d
�!|��z���nt7d|j��|_|`
|j"sE|j#�d|j	��|_"||j"|j$�%����|_"dSdS)Nr)�
connection)�
truncate_name�_r F>r-r.z{}sz)'class Meta' got invalid attribute(s): %s�,)&�	django.dbry�django.db.backends.utilsrz�_meta�model�__name__r_�lowerr]rr�original_attrsra�__dict__�copy�
startswith�
DEFAULT_NAMES�setattr�pop�getattr�hasattrr=rr%�_format_names_with_classrr�boolrrr^r:�joinrr�ops�max_name_length)ri�clsrAryrz�
meta_attrs�	attr_name�objss        r5�contribute_to_classzOptions.contribute_to_class�s���(�(�(�(�(�(�:�:�:�:�:�:���	���
��<����*�0�0�2�2���0��1A�B�B���!����9�%	M���+�0�0�2�2�J��	�*�
)�
)���?�?�3�'�'�)�"�4�(��*�
N�
N�	��
�*�*��D�)�Z�^�^�I�-F�-F�G�G�G�5<�T�9�5M�5M�D�'�	�2�2��T�Y�	�2�2�N��D�)�W�T�Y�	�-J�-J�K�K�K�5<�T�9�5M�5M�D�'�	�2��#5�d�6J�#K�#K�D� �"4�T�5H�"I�"I�D���3�9�j�%�8�8�
W�!;�W�W�I�"�4��B�7�7�D��D�)�T�-J�-J�3�PT�-U�-U�V�V�V�V��'�/�+6�u�d�>O�+P�+P��(�$(��
�(T�$�:T�#U�#U�D� ��R���� K�c�h�h�Wa�Nb�Nb� b�c�c�c� �(3�5�$�:K�'L�'L�D�$��I��}�	[�'+�~�~�~�t���G�D�M�)�M�$�-���9W�9W�9Y�9Y�Z�Z�D�M�M�M�	[�	[r7c���g}|D]p}|���}|j|jj���|j���d�z|_|�|���q|S)z4App label/class name interpolation for object names.)r�class)�clonerArrr�r��append)rir�r��new_objs�objs     r5r�z Options._format_names_with_class�s|�����	!�	!�C��)�)�+�+�C��x� �Y�0�6�6�8�8���+�+�-�-�#�#��C�H�
�O�O�C� � � � ��r7c��t|jdtj��}|jr3|jjr't|j��}|j�d|j�d�}nd}|st|�d����	t|��}n*#t$r}|�d|�d�}t|��|�d}~wwxYwt|t��std|�d	|�d
����|S)N�default_auto_fieldrmz.default_auto_field�DEFAULT_AUTO_FIELDz must not be empty.z refers to the module 'z' that could not be imported.z
Primary key 'z' referred by z must subclass AutoField.)r�rurr��!_is_default_auto_field_overridden�type�
__module__�__qualname__rr�ImportError�
issubclassr	�
ValueError)ri�
pk_class_path�app_config_class�source�pk_class�e�msgs       r5�_get_default_pk_classzOptions._get_default_pk_class�sV����O� ��'�
�
�
�
�?�	*�t��P�	*�#�D�O�4�4��#�.�F�F�#�0�F�F�F�
�F�
*�F��	G�&�&�'E�'E�'E�F�F�F�	3�$�]�3�3�H�H���	3�	3�	3��$�$�-�$�$�$�
�'�s�+�+��2�����	3�����(�I�.�.�	��'�
�'�'�V�'�'�'���
��s�2B�
B)�B$�$B)c����|jr�|j�	t�fd�|�d���D����|_n(#t$rt	|j�d��d����wxYwd|_td�|jj	D����s"|�
dt����nd|_|j��|j
rntt|j
���������fd	�|j	D��}|r|d
�d�_|����dS|���}|ddd�
��}|�
d|��dSdS)Nc3�H�K�|]}|j�ks|j�k�|V��dSr1)rA�attname)r3�f�querys  �r5r6z#Options._prepare.<locals>.<genexpr>sF�����2�2���v����!�)�u�*<�*<��*<�*<�*<�*<�2�2r7F��reverse� has no field named '�')�_orderc3�@K�|]}t|t��V��dSr1)r8r�r3�fields  r5r6z#Options._prepare.<locals>.<genexpr>
s,����Y�Y�u�z�%��2�2�Y�Y�Y�Y�Y�Yr7r�c�4��g|]}|j�jk�|��Sr�rA)r3�fldr�s  �r5�
<listcomp>z$Options._prepare.<locals>.<listcomp>s)���"^�"^�"^�3�s�x�SX�S]�G]�G]�3�G]�G]�G]r7rT�ID)r�primary_keyr$�id)r�next�_get_fields�
StopIterationrr_r�anyrrY�add_to_classrrbrf�iter�valuesr��setup_pkr�)rir��already_createdr��autor�r�s     @@r5�_preparezOptions._prepare�s������%�	.��.�E�
b�-1�2�2�2�2�#�/�/��/�>�>�2�2�2�.�.��*�*��!�
b�
b�
b�'��HX�HX�HX�Z_�Z_�Z_�(`�a�a�a�
b����(�D�M��Y�Y���@X�Y�Y�Y�Y�Y�
9��"�"�8�X�Z�Z�8�8�8��)-�D�&��7�?��|�
/��T�$�,�"5�"5�"7�"7�8�8�9�9��#_�"^�"^�"^�$�2C�"^�"^�"^��"�/�+�A�.�E�$(��!��
�
�e�$�$�$�$�$��5�5�7�7���x�T�t�RV�W�W�W���"�"�4��.�.�.�.�.�!�?s�4A�%A,c�b�|j�|��|���dSr1)r\r��
_expire_cache)ri�managers  r5�add_managerzOptions.add_manager!s1����"�"�7�+�+�+��������r7Fc��|r|j�|��nX|jr"|jrt	j|j|��n/t	j|j|��|�|��|jrnt|j
d��rY|j
jrM	|j
jj�
d���n#t$rYnwxYw|�
��dS|�
d���dS)Nr�F)�forwardr�)r[r��is_relationrJ�bisect�insortrZrYr�r��remote_fieldr�rr��AttributeError)rir��privates   r5�	add_fieldzOptions.add_field%s%��
�	!���&�&�u�-�-�-�-�
�
�	!�5�#5�	!��M�$�1�5�9�9�9�9��M�$�+�U�3�3�3��M�M�%� � � ���	.���);�W�!E�!E�	.�%�J\�Jb�	.�
��"�(�.�<�<�U�<�K�K�K�K��!�
�
�
���
������� � � � � ����u��-�-�-�-�-s�%C�
C�Cc�F�|js|jr||_d|_dSdSdS)NF)rbr��	serialize)rir�s  r5r�zOptions.setup_pkCs<���w�	$�5�,�	$��D�G�#�E�O�O�O�	$�	$�	$�	$r7c�X�|jj|_||_|jj|_dS)zb
        Do the internal setup so that the current model is a proxy for
        "target".
        N)rrbrdr)ri�targets  r5�setup_proxyzOptions.setup_proxyHs'��
�,�/���%�����-��
�
�
r7c��d|jzS)Nz<Options for %s>)r_rns r5�__repr__zOptions.__repr__Qs��!�D�$4�4�4r7c��|jSr1)rqrns r5�__str__zOptions.__str__Ts����r7c���|js|js|jsdSt�t��r
t
��|jr|j�jkS|jr t�fd�|jD����SdS)z�
        Return True if the model can/should be migrated on the `connection`.
        `connection` can be either a real connection or a connection alias.
        Fc3�D�K�|]}t�j|d��V��dS)FN)r��features)r3�featrys  �r5r6z&Options.can_migrate.<locals>.<genexpr>csF�����>�>���z�2�D�%�@�@�>�>�>�>�>�>r7T)
r"�swappedr!r8�strrr*�vendorr)�all)rirys `r5�can_migratezOptions.can_migrateWs����
�:�	���	�T�\�	��5��j�#�&�&�	1�$�Z�0�J��"�	@��*�j�.?�?�?��$�	>��>�>�>�>�#'�#<�>�>�>�>�>�
>��tr7c�|�td��5t|j��cddd��S#1swxYwYdS)z%Return the untranslated verbose name.N)rr�rrns r5�verbose_name_rawzOptions.verbose_name_rawgs����d�^�^�	*�	*��t�(�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s�1�5�5c���|jrmtt|jd��}|rP	|�d��\}}n#t$r|cYSwxYw|�d|�����|jkr|SdS)a!
        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.
        Nrm)r#r�r�splitr�r�rq)ri�swapped_for�
swapped_label�swapped_objects    r5r�zOptions.swappedms����>�
	'�!�(�D�N�D�A�A�K��
'�'�4?�4E�4E�c�4J�4J�1�M�>�>��!�'�'�'�
'�&�&�&�'����,�m�m�^�-A�-A�-C�-C�-C�D��HX�X�X�&�&��ts�?�A�
Ac��g}t��}d�|j���D��}t|��D]u\}}|jjD]c}|j|vr�tj|��}|j|_|�|j��|�	||j
|f���d�vtdd�t|��D����S)Nc3�:K�|]}t|d���|V��dS)rN)r�)r3�bs  r5r6z#Options.managers.<locals>.<genexpr>�s1����D�D�q���7�0C�0C�D��D�D�D�D�D�Dr7rGc3�&K�|]}|dV��
dS)�Nr)r3�ms  r5r6z#Options.managers.<locals>.<genexpr>�s&����,�,�a�Q�q�T�,�,�,�,�,�,r7)
�setr��mro�	enumeraterr\rAr�rTr��creation_counterrC�sorted)rirG�
seen_managers�bases�depth�baser�s       r5rGzOptions.managers�s��������
�D�D�D�J�N�N�,�,�D�D�D��$�U�+�+�	L�	L�K�E�4��:�4�
L�
L���<�=�0�0���)�G�,�,�� $�
��
��!�!�'�,�/�/�/������(@�'� J�K�K�K�K�
L�*��,�,�6�(�+�+�,�,�,�
�
�	
r7c�$�d�|jD��S)Nc��i|]
}|j|��Srr�)r3r�s  r5�
<dictcomp>z(Options.managers_map.<locals>.<dictcomp>�s��C�C�C�'���g�C�C�Cr7)rGrns r5rIzOptions.managers_map�s��C�C�T�]�C�C�C�Cr7c�z�|j}|sR|j���dd�D]0}t|d��r|jjdkr|jj}n�1|r5	|j|S#t$rt|j	�d|�����wxYwt��}d|_|j|_d|_|S)N�r�
_base_manager� has no manager named T)r+r�r�r�rrArI�KeyErrorr�r_r
r$)rir+�parentr�s    r5rHzOptions.base_manager�s��� �2�� �	��*�.�.�*�*�1�2�2�.�
�
���6�7�+�+���+�0�O�C�C�,2�,@�,E�)��E��
�		�
��(�):�;�;���
�
�
� ��(�(�(�)�)�����
�����)�)��&����
��
�#����s�A,�,$Bc�@�|j}|sI|jsB|j���dd�D] }t	|d��r|jj}n�!|r5	|j|S#t$rt|j	�d|�����wxYw|j
r
|j
dSdS)Nrrrr)r,r\r�r�r�rrIrr�r_rG)rir,r	s   r5rLzOptions.default_manager�s���#�8��#�	�D�,?�	��*�.�.�*�*�1�2�2�.�
�
���6�7�+�+��+1�<�+L�(��E�� �		�
��(�)=�>�>���
�
�
� ��(�(�(�,�,�����
�����=�	$��=��#�#�	$�	$s�A#�#$Bc�~����d��d��d��td���fd�|�d���D����S)a1
        Return a list of all forward fields on the model and its parents,
        excluding ManyToManyFields.

        Private API intended only to be used by Django itself; get_fields()
        combined with filtering of field properties is the public API for
        obtaining this field list.
        c� �|jo|jSr1�r�rJ�r�s r5�is_not_an_m2m_fieldz+Options.fields.<locals>.is_not_an_m2m_field�s���
�8�!�.�9�9r7c� �|jo|jSr1)r��one_to_manyrs r5�is_not_a_generic_relationz1Options.fields.<locals>.is_not_a_generic_relation�s���
�7�!�-�8�8r7c�d�|jo(|jo!t|jd��o|jjS)Nr�)r��many_to_oner�r�r�rs r5�is_not_a_generic_foreign_keyz4Options.fields.<locals>.is_not_a_generic_foreign_key�s9���
�s�!�-�s����QX�9Y�9Y�9r�^_�^l�^r�4s��
r7rFc3�^�K�|]'}�|���
�|����|���#|V��(dSr1r)r3r�rrrs  ���r5r6z!Options.fields.<locals>.<genexpr>�sx�����
m�
m�1�#�#�A�&�&�
m�+D�+D�Q�+G�+G�
m�Lh�Lh�ij�Lk�Lk�
m�Q�
m�
m�
m�
m�
m�
mr7Fr��rCr�)rirrrs @@@r5rFzOptions.fields�s������"	:�	:�	:�	9�	9�	9�	�	�	�
*��
m�
m�
m�
m�
m�
m��(�(��(�7�7�
m�
m�
m�
�
�	
r7c�@�tdd�|jD����S)a
        Return a list of all concrete fields on the model and its parents.

        Private API intended only to be used by Django itself; get_fields()
        combined with filtering of field properties is the public API for
        obtaining this field list.
        rKc3�(K�|]
}|j�	|V��dSr1��concrete�r3r�s  r5r6z*Options.concrete_fields.<locals>.<genexpr>�s)����E�E�a�!�*�E��E�E�E�E�E�Er7)rCrFrns r5rKzOptions.concrete_fields�s,��*��E�E�4�;�E�E�E�
�
�	
r7c�@�tdd�|jD����S)z�
        Return a list of all concrete fields on the model.

        Private API intended only to be used by Django itself; get_fields()
        combined with filtering of field properties is the public API for
        obtaining this field list.
        rNc3�(K�|]
}|j�	|V��dSr1rrs  r5r6z0Options.local_concrete_fields.<locals>.<genexpr>s)����%Q�%Q�A�a�j�%Q�a�%Q�%Q�%Q�%Q�%Q�%Qr7)rCrYrns r5rNzOptions.local_concrete_fieldss-��*�#�%Q�%Q��1B�%Q�%Q�%Q�
�
�	
r7c�^�tdd�|�d���D����S)a
        Return a list of all many to many fields on the model and its parents.

        Private API intended only to be used by Django itself; get_fields()
        combined with filtering of field properties is the public API for
        obtaining this list.
        rJc3�6K�|]}|j�	|j�|V��dSr1r
rs  r5r6z'Options.many_to_many.<locals>.<genexpr>s0����\�\�1�1�=�\�Q�^�\�Q�\�\�\�\�\�\r7Fr�rrns r5rJzOptions.many_to_manys;��*��\�\��(�(��(�7�7�\�\�\�
�
�	
r7c�f�|�ddd���}tdd�|D����S)aw
        Return all related objects pointing to the current model. The related
        objects can come from a one-to-one, one-to-many, or many-to-many field
        relation type.

        Private API intended only to be used by Django itself; get_fields()
        combined with filtering of field properties is the public API for
        obtaining this field list.
        FT)r�r��include_hiddenrQc3�@K�|]}|jr|jj�|V��dSr1)�hiddenr�rJ)r3r�s  r5r6z*Options.related_objects.<locals>.<genexpr>*s3����[�[�S�c�j�[�C�I�DZ�[�S�[�[�[�[�[�[r7)r�rC)ri�all_related_fieldss  r5rQzOptions.related_objectssG��"�-�-�e�T�Z^�-�_�_��)��[�[�.�[�[�[�
�
�	
r7c��i}|�d���}|D]'}|||j<	|||j<�#t$rY�$wxYw|S)NFr��r�rAr�r��ri�resrFr�s    r5rMzOptions._forward_fields_map-sp�����!�!�%�!�0�0���	�	�E�#�C��
�O�
�%*��E�M�"�"��!�
�
�
���
�����
s�
3�
A�Ac��i}|�dd���}|D]'}|||j<	|||j<�#t$rY�$wxYw|S)NFT)r�r"r'r(s    r5rOzOptions.fields_map<sr�����!�!�%��!�E�E���	�	�E�#�C��
�O�
�%*��E�M�"�"��!�
�
�
���
�����
s�
4�
A�Ac��	|j|S#t$r)|jjst	|j�d|�d����YnwxYw	|j|S#t$rt	|j�d|�d����wxYw)zW
        Return a field instance given the name of a forward or reverse field.
        r�zi'. The app cache isn't ready yet, so if this is an auto-created related field, it won't be available yet.r�)rMrr�models_readyrr_rO)ri�
field_names  r5�	get_fieldzOptions.get_fieldKs���	��+�J�7�7���	�	�	��9�)�
�'�,0�+;�+;�+;�Z�Z�Z�I����
�
�	����	c��?�:�.�.���	c�	c�	c�#�D�DT�DT�DT�V`�V`�V`�$a�b�b�b�	c���s��0A�A�A�%A8c��|jsgS||jvr|gS|jD]8}|j�|��}|r|�d|��|cS�9gS)z�
        Return a list of parent classes leading to `model` (ordered from
        closest to most distant ancestor). This has to handle the case where
        `model` is a grandparent or even more distant relation.
        r)rfr�get_base_chain�insert)rir�r	r)s    r5r0zOptions.get_base_chainds~���|�	��I��D�L� � ��7�N��l�	�	�F��,�-�-�e�4�4�C��
��
�
�1�f�%�%�%��
�
�
�
��	r7c��t|j��}|jD]3}|j���D]}|�|����4t|��S)z�
        Return all the ancestors of this model as a list ordered by MRO.
        Useful for determining if something is an ancestor, regardless of lineage.
        )rrfr�get_parent_listrTr9)ri�resultr	�ancestors    r5r3zOptions.get_parent_listusg��
�D�L�)�)���l�	%�	%�F�"�L�8�8�:�:�
%�
%���
�
�8�$�$�$�$�
%��F�|�|�r7c��||jvr
|j|S|jD]/}|j�|��}|r|j|p|cS�0dS)a\
        Return 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.

        Return None if the model isn't an ancestor of this one.
        N)rfr�get_ancestor_link)rir5r	�parent_links    r5r7zOptions.get_ancestor_link�su���t�|�#�#��<��)�)��l�	;�	;�F� �,�8�8��B�B�K��
;��|�F�+�:�{�:�:�:�	
;�	;�	;r7c�<�|j|urgS|j}g}|}|�|��D]o}||ur|j}�|j|}|j���f}|j}|�t|jj|||ddd������p|S)z�
        Return a list of PathInfos containing the path from the current
        model to the parent model, or an empty list if parent is not a
        parent of the current model.
        FTN)�	from_opts�to_opts�
target_fields�
join_field�m2m�direct�filtered_relation)	r�rer0rrfr��get_related_fieldr�r
)rir	�
proxied_model�path�opts�	int_model�final_field�targetss        r5�get_path_to_parentzOptions.get_path_to_parent�s����:�����I��+�
������,�,�V�4�4�	�	�I��M�)�)� ����"�l�9�5��&�3�E�E�G�G�I�� ������H�)�/�5� �")�*���&*���������r7c��|j|urgS|j}|j�|��}|���|�|��g}t
|dd���D]Q\}}||dz}|j�|��}|�|�	�����R|S)z�
        Return a list of PathInfos containing the path from the parent
        model to the current model, or an empty list if parent is not a
        parent of the current model.
        N���r)
r�rerr0r�r�r�r7�extend�get_reverse_path_info)	rir	r��chainrC�ir5�child�links	         r5�get_path_from_parentzOptions.get_path_from_parent�s����:�����I��#����*�*�6�2�2��
�
�
����
���U������$�U�3�B�3�Z�0�0�	6�	6�K�A�x��!�a�%�L�E��;�0�0��:�:�D��K�K��2�2�4�4�5�5�5�5��r7c�(�tt��}|j�d���}|D]�}|j}|jr�d�|�dd���D��}|D]\}t|jj	t��s;|jj	jjjj}||�
|���]��|D]-}||jjjj}||jjd<�.|j�dt ��S)a%
        This method is used by each model to find its reverse objects. As this
        method is very expensive and is accessed frequently (it looks up every
        field in a model, in every app), it is computed on first access and then
        is set as a property on every model.
        T)�include_auto_createdc3�6K�|]}|jr|j�|V��dSr1)r��
related_modelrs  r5r6z<Options._populate_directed_relation_graph.<locals>.<genexpr>�s@����%�%���=�%�%&�_�%@��%@�%@�%@�%@�%�%r7F)r��include_parentsrP)rr9r�
get_modelsrr r�r8r�r�r�reror�r�rt�EMPTY_RELATION_TREE)	ri�related_objects_graph�
all_modelsr�rD�fields_with_relationsr��remote_labelrQs	         r5�!_populate_directed_relation_graphz)Options._populate_directed_relation_graph�s=��!,�D� 1� 1���Y�)�)�t�)�D�D�
��
	B�
	B�E��;�D��}�
��%�%��+�+�E�5�+�Q�Q�%�%�%�!�+�
B�
B��!�!�.�"6��<�<�B�#$�>�#7�#=�#L�#R�#X�L�)�,�7�>�>�q�A�A�A��
B�
 �	E�	E�E�4�E�K�4N�4T�4Z�[�O�5D�E�K� �!1�2�2��}� � �!1�3F�G�G�Gr7c�*�|���Sr1)r]rns r5rPzOptions._relation_tree�s���5�5�7�7�7r7Tc��|r#|jD]}||jvrt||���|r*|js#|jD]}||jvrt||���i|_dSr1)�FORWARD_PROPERTIESr��delattrr �REVERSE_PROPERTIESrX)rir�r��	cache_keys    r5r�zOptions._expire_cache�s����	-�!�4�
-�
-�	���
�-�-��D�)�,�,�,���	-�4�=�	-�!�4�
-�
-�	���
�-�-��D�)�,�,�,��!#����r7c�F�|durt}|�||���S)a�
        Return a list of fields associated to the model. By default, include
        forward and reverse fields, fields derived from inheritance, but not
        hidden fields. The returned fields can be changed using the parameters:

        - include_parents: include fields derived from inheritance
        - include_hidden:  include fields that have a related_name that
                           starts with a "+"
        F)rVr")�
PROXY_PARENTSr�)rirVr"s   r5�
get_fieldszOptions.get_fields�s.���e�#�#�+�O�����P^��_�_�_r7c��|ddtfvrtd|�����|du}|rt��}|�|j��|||||f}	|j|S#t$rYnwxYwg}|dur�|jD]�}	|	|vr�|	jj	|j	kr|tkr�(|	j�
|||||���D]8}
t|
dd��r|
j|j	kr|�|
���9��|r;|j
s4|j}|D]*}|s|jjs|�|j���+|r ||jz
}||jz
}|r
||jz
}t)d|��}||j|<|S)a�
        Internal helper function to return fields of the model.
        * If forward=True, then fields defined on this model are returned.
        * If reverse=True, then relations pointing to this model are returned.
        * If include_hidden=True, then fields with is_hidden=True are returned.
        * The include_parents argument toggles if fields from parent models
          should be included. It has three values: True, False, and
          PROXY_PARENTS. When set to PROXY_PARENTS, the call will return all
          fields defined for the current model or any of its parents in the
          parent chain to the model's concrete model.
        TFz&Invalid argument for include_parents: N)r�r�rVr"�seen_modelsr8zget_fields())rer:r�rTr�rXrrfrrer�r�r�r"rPr�r$rYrZr[rC)
rir�r�rVr"rh�topmost_callrcrFr	r��
all_fieldsr�s
             r5r�zOptions._get_fieldss!���4��
�">�>�>��)�/�/�[�\�\�\�#�d�*���	 ��%�%�K�����
�#�#�#��g����U�	�	��)�)�4�4���	�	�	��D�	�������%�'�'��,�

+�

+���[�(�(���L�/�4�3F�F�F�'�=�8�8��!�<�3�3� '��/�'5�;�4�P�P�+�+�C�#�3�
�u�=�=�+���d�Na�Aa�Aa��
�
�c�*�*�*��	+�
�		6�4�:�		6��,�J�#�
6�
6��"�6��);�)B�6��M�M�%�"4�5�5�5���		.��d�'�'�F��d�-�-�F��
.��$�-�-��,�N�F�C�C��-3���y�)��
s�A"�"
A/�.A/c�$�d�|jD��S)z�
        Return a list of total unique constraints. Useful for determining set
        of fields guaranteed to be unique for all rows.
        c�J�g|] }t|t��r	|j�|��!Sr1)r8r�	condition)r3�
constraints  r5r�z4Options.total_unique_constraints.<locals>.<listcomp>fsA��
�
�
���*�&6�7�7�
�=G�<P�<X�
�<X�<X�<Xr7)r.rns r5�total_unique_constraintsz Options.total_unique_constraints`s&��
�
�"�.�
�
�
�	
r7c���g}t|j��D]F}tj|j|��}t	|t
��r|�|���Gt|��S)zAReturn a set of the names of the properties defined on the model.)�dirr��inspect�getattr_staticr8�propertyr��	frozenset)ri�namesrA�attrs    r5�_property_nameszOptions._property_nameslsg������
�O�O�	#�	#�D��)�$�*�d�;�;�D��$��)�)�
#����T�"�"�"������r7c�P�d�|�ddt���D��S)z
        Private API intended only to be used by Django itself.
        Fields to be returned after a database insert.
        c�4�g|]}t|dd���|��S)�db_returningF)r�r�s  r5r�z/Options.db_returning_fields.<locals>.<listcomp>|s:��
�
�
���u�n�e�4�4�
��
�
�
r7TF)r�r�rV)r�rerns r5�db_returning_fieldszOptions.db_returning_fieldsvs9��
�
�#�/�/��e�]j�/�k�k�
�
�
�	
r7r1)F)TT)TF)TTTFN)4r�r�r�r`rbrrhrjrtrorqrurwr�r�r�r�r�r�r�r�r�r�r�r�r�rrGrIrHrLrFrKrNrJrQrMrOr.r0r3r7rHrQr]rPr�rfr�rorxr|rr7r5rErE@s�����������
M�L�L���L�7)�7)�7)�7)�r�<�<��X�<��;�;��X�;��9�9��X�9��+�+��X�+�;[�;[�;[�z
�
�
����>#/�#/�#/�J���.�.�.�.�<$�$�$�
.�.�.�5�5�5� � � ���� �*�*��X�*�
����X��0�
�
��_�
�&�D�D��_�D�����_��6�$�$��_�$�.�
�
��_�
�B�

�

��_�

��

�

��_�

��
�
��_�
��
�
��_�
� ����_������_��c�c�c�2���"	�	�	�;�;�;�(���<���,#H�#H�#H�J�8�8��_�8�$�$�$�$�`�`�`�`�\a� $�R�R�R�R�h�	
�	
��_�	
�� � ��_� ��
�
��_�
�
�
r7rE))r�r�rr�collectionsr�django.appsr�django.confr�django.core.exceptionsrrr}r�django.db.modelsr	r
rr�django.db.models.query_utilsr
�django.utils.datastructuresrr�django.utils.functionalr�django.utils.module_loadingr�django.utils.textrr�django.utils.translationr�objectrerXr@r�r=rCrErr7r5�<module>r�s���
�
�
�
���������#�#�#�#�#�#������� � � � � � �J�J�J�J�J�J�J�J�!�!�!�!�!�!�K�K�K�K�K�K�K�K�K�K�K�K�1�1�1�1�1�1�A�A�A�A�A�A�A�A�3�3�3�3�3�3�5�5�5�5�5�5�?�?�?�?�?�?�?�?�-�-�-�-�-�-�����
���+��
�
����,A�A�A�
�
�
�
�
�
�
�
�
�
r7

Youez - 2016 - github.com/yon3zu
LinuXploit