관리-도구
편집 파일: forms.cpython-311.pyc
� �܋f� � �| � d Z ddlmZmZmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ d� Z G d � d e� � ZdS )zModels.� )�Assign� AssignName�ClassDef)�BaseChecker)�check_messages)�IAstroidChecker)�BASE_ID)�node_is_subclassc �| � | � � � D ]&}t |t � � r|j dk r|c S �'d S )N�Meta)�get_children� isinstancer �name)�node�childs �m/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint_django/checkers/forms.py�_get_child_metar sJ � ��"�"�$�$� � ���e�X�&�&� �5�:��+?�+?��L�L�L���4� c �R � e Zd ZdZeZdZde� d�diZ e d� � d� � � Z dS ) �FormCheckerzDjango model checker.zdjango-form-checker�W�04)z3Use explicit fields instead of exclude in ModelForm�modelform-uses-excludez`Prevents accidentally allowing users to set fields, especially when adding new fields to a Modelr c �^ � t |dd� � sdS t |� � }|sdS |� � � D ]q}t |t � � r t |j d t � � s�8|j d j dk r#| � dt � d�|�� � dS �rdS ) zClass visitor.zdjango.forms.models.ModelFormz .ModelFormNr �excluder r )r ) r r r r r �targetsr r �add_messager )�selfr �metar s r �visit_classdefzFormChecker.visit_classdef s� � � ��&E�|�T�T� ��F��t�$�$��� ��F��&�&�(�(� � �E��e�V�,�,� �J�u�}�Q�?O�Q[�4\�4\� ���}�Q��$� �1�1�� � ��W����u� �=�=�=���� 2� � r N)�__name__� __module__�__qualname__�__doc__r �__implements__r r �msgsr r � r r r r sb � � � � � ���$�N� �D��G���� ��D� �^�,�-�-�� � .�-�� � r r N)r$ � astroid.nodesr r r �pylint.checkersr �pylint.checkers.utilsr �pylint.interfacesr �pylint_django.__pkginfo__r �pylint_django.utilsr r r r'