| 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/migrations/operations/__pycache__/ |
Upload File : |
�
�|�e� � �X � d dl mZ d dlmZ dd�Z edd� � Z dd�Zdd �Zd
� ZdS )
� )�
namedtuple)�RECURSIVE_RELATIONSHIP_CONSTANTNc �T � t | t � � r|| t k r|�|�t d� � �||fS d| v r/| � dd� � \ }}||� � � fS |�t d� � �|| � � � fS | j j | j j fS )z�
Turn a model class or model reference string and return a model tuple.
app_label and model_name are used to resolve the scope of recursive and
unscoped model relationship.
NzMapp_label and model_name must be provided to resolve recursive relationships.�.� zCapp_label must be provided to resolve unscoped model relationships.) �
isinstance�strr � TypeError�split�lower�_meta� app_label�
model_name)�modelr r s �G/usr/lib/python3/dist-packages/django/db/migrations/operations/utils.py�resolve_relationr s� � � �%���� (��3�3�3�� �J�$6��/�� � � �j�(�(��%�<�<�$)�K�K��Q�$7�$7�!�I�z��j�.�.�0�0�0�0����!�� �
� �%�+�+�-�-�'�'��;� �%�+�"8�8�8� �FieldReferencez
to throughc �: � |j }|sdS d}d}t |j g| �R � |k r*t |dd� � }|�|�d|v r |�|j s||v r||f}t |dd� � } | r$t | g| �R � |k r|j }
|�|
�||
v r||
f}|s|sdS t
||� � S )at
Return either False or a FieldReference if `field` references provided
context.
False positives can be returned if `reference_field_name` is provided
without `reference_field` because of the introspection limitation it
incurs. This should not be an issue when this function is used to determine
whether or not an optimization can take place.
FN� to_fields�through)�remote_fieldr r �getattr�primary_key�through_fieldsr )�model_tuple�field�reference_model_tuple�reference_field_name�reference_fieldr �
references_to�references_throughr r r s r �field_referencesr# $ s � � �%�L�� ��u��M�����*�9�[�9�9�9�=R�R�R��E�;��5�5� � �(���
�Y�
�
�O�$;��?Z�$;� �I�-�-�)�9�5�M��l�I�t�4�4�G�� @�#�G�:�k�:�:�:�>S�S�S�%�4�� �(��"� �N�2�2�".��!?��� �/� ��u��-�);�<�<�<r � c # � K � | j � � � D ]=\ }}|j � � � D ]\ }}t |||g|�R � }|r||||fV � ��>dS )z�
Generator of (model_state, name, field, reference) referencing
provided context.
If field_tuple is provided only references to this particular field of
model_tuple will be generated.
N)�models�items�fieldsr# )�stater �field_tuple�state_model_tuple�model_state�namer � references r �get_referencesr/ U s� � � � � +0�,�*<�*<�*>�*>� :� :�&��;�&�-�3�3�5�5� :� :�K�D�%�(�):�E�;�]�Q\�]�]�]�I��
:�!�4�� �9�9�9�9�� :�:� :r c �D � t t | ||� � d� � duS )z?Return whether `field_tuple` is referenced by any state models.N)�nextr/ )r) r r* s r �field_is_referencedr2 d s# � ���u�k�;�?�?��F�F�d�R�Rr )NN)r$ ) �collectionsr �django.db.models.fields.relatedr r r r# r/ r2 r$ r r �<module>r5 s� �� "� "� "� "� "� "� K� K� K� K� K� K�9� 9� 9� 9�6 ��,�l�;�;�� ��.=� .=� .=� .=�b:� :� :� :�S� S� S� S� Sr