← Back
Editing: utils.cpython-311.pyc
� �|�el � �� � d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z mZmZm Z d dlmZ d� Zd � Ze G d � de� � � � Ze G d� d ee� � � � Zd� Zd� ZdS )� N)�UserList)�settings)�ValidationError)�timezone)�escape�format_html�format_html_join� html_safe)�gettext_lazyc �Z � | sdS | � dd� � � � � S )z%Convert 'first_name' to 'First name'.� �_� )�replace� capitalize)�names �4/usr/lib/python3/dist-packages/django/forms/utils.py�pretty_namer s/ � �� ��r��<�<��S�!�!�,�,�.�.�.� c �F � g }g }| � � � D ]L\ }}t |t � � r|r|� |f� � �3|�|� ||f� � �Mt ddt |� � � � t ddt |� � � � z S )a� Convert a dictionary of attributes to a single string. The returned string will contain a leading space followed by key="value", XML-style pairs. In the case of a boolean value, the key will appear without a value. It is assumed that the keys do not need to be XML-escaped. If the passed dictionary is empty, then return an empty string. The result is passed through 'mark_safe' (by way of 'format_html_join'). Nr z {}="{}"z {})�items� isinstance�bool�appendr �sorted)�attrs�key_value_attrs� boolean_attrs�attr�values r �flatattr! s� � � �O��M��{�{�}�}� 2� 2���e��e�T�"�"� 2�� .��$�$�d�W�-�-�-�� � ��"�"�D�%�=�1�1�1�� ��Z���)@�)@�A�A���U�F�=�$9�$9�:�:� ;�r c �: � e Zd ZdZd� Zd d�Zd d�Zd� Zd� Zd� Z d S )� ErrorDictz� A collection of errors that knows how to display itself in various formats. The dictionary keys are the field names, and the values are the errors. c �>