관리-도구
편집 파일: foreignkey.cpython-311.pyc
� �܋f � �j � d dl mZ d dlmZmZmZmZmZ d dlm Z m Z d dlmZ d� Z d� Zd� Zdd �Zd � ZdS )� )�chain)�MANAGER�InferenceError�UseInferenceDefault� inference_tip�nodes)� Attribute�ClassDef)�node_is_subclassc �v � t | j t j � � sdS t | j j t � � sdS t | j j dd� � }|sdS t | j t � � r | j j }n.t | j t j � � r | j j }ndS |dv S )NF�django.db.models.base.Modelz.Model)� OneToOneField� ForeignKey)� isinstance�parentr �Assignr r �funcr �attrname�Name�name)�node�is_in_django_model_class�attrs �t/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint_django/transforms/foreignkey.py�is_foreignkey_in_classr s� � ��d�k�5�<�0�0� ��u��d�k�(�(�3�3� ��u� 0���0B�Da�ck�l�l��#� ��u��$�)�Y�'�'� ��y�!��� �D�I�u�z� *� *� ��y�~����u��2�2�2� c �j � g }| � |� � d D ]�}t |t j � � r&t |d� � r|� |� � �Bt |t j � � r8|� � � }|� t |||� � � � ��|S )N� r ) �lookupr r r r �append� ImportFrom�do_import_module�extend�!_get_model_class_defs_from_module)�module� model_name�module_name� class_defs�module_node�imported_modules r r$ r$ s� � ��J��}�}�Z�0�0��3� k� k���k�5�>�2�2� k�7G��Ur�7s�7s� k����k�*�*�*�*� ��U�%5� 6� 6� k�)�:�:�<�<�O����?��Q[�]h�i�i�j�j�j���r c � � dd l }|� � � ddlm} |� |� � }|� | � � }|j S )Nr )�apps)�django�setup�django.appsr, �get_app_config� get_model� __module__)r&