관리-도구
편집 파일: models.cpython-311.pyc
� �܋f � �� � d Z ddlmZ ddlmZmZmZmZ ddlm Z ddl mZ ddlm Z ddlmZ ddlmZmZ d e� d �dde� d �d de� d�dde� d�diZd� Zd� Zd� Z G d� de � � ZdS )zModels.� )�Const)�Assign� AssignName�ClassDef�FunctionDef)�BaseChecker)�check_messages)�IAstroidChecker)�BASE_ID)�PY3�node_is_subclass�E�01)z,__unicode__ on a model must be callable (%s)zmodel-unicode-not-callablez3Django models require a callable __unicode__ method�W)z#No __unicode__ method on model (%s)�model-missing-unicodezMDjango models should implement a __unicode__ method for string representation�02)z=Found __unicode__ method on model (%s). Python3 uses __str__.zmodel-has-unicodezdDjango models should not implement a __unicode__ method for string representation when using Python3�03)z1Model does not explicitly define __unicode__ (%s)zmodel-no-explicit-unicodez�Django models should implement a __unicode__ method for string representation. A parent class of this model does, but ideally all models should be explicit.c �" � t | t � � ry| j dk rn| � � � D ]Y}t |t � � s�|j d j dk s�/t |j t � � s�J|j j r dS �ZdS )N�Metar �abstractTF)� isinstancer �name�get_childrenr �targets�valuer )�node� meta_childs �n/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint_django/checkers/models.py�_is_meta_with_abstractr $ s� � ��$��!�!� �d�i�6�&9�&9��+�+�-�-� � �J��j�&�1�1� ���%�a�(�-��;�;���j�.��6�6� �� ��%� ��t�t� � �5� c �f � | j �dS | j j D ]}t |dd � � dk r dS �dS )NFr �python_2_unicode_compatibleT)� decorators�nodes�getattr)r � decorators r �*_has_python_2_unicode_compatible_decoratorr'