HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/lib/__pycache__/util_wtforms.cpython-310.pyc
o

�we�	�@s@ddlmZddlmZGdd�de�Zddd�Zddd	�Zd
S)�)�	FlaskForm)�lazy_gettextcs"eZdZdZd�fdd�	Z�ZS)�	ModelForma�
    wtforms_components exposes ModelForm but their ModelForm does not inherit
    from flask_wtf's Form, but instead WTForm's Form.

    However, in order to get csrf protection handled by default we need to
    inherit from flask_wtf's Form. So let's just copy his class directly.

    We modified it by removing the format argument so that wtforms_component
    uses its own default which is to pass in request.form automatically.
    N�cs"t�jd||d�|��||_dS)N)�obj�prefix�)�super�__init__�_obj)�selfrr�kwargs��	__class__r�</home/arjun/projects/buyercall/buyercall/lib/util_wtforms.pyr
s
zModelForm.__init__)Nr)�__name__�
__module__�__qualname__�__doc__r
�
__classcell__rrrrrsrTcCsBg}|r
|�dtd�f�|��D]
\}}||f}|�|�q|S)a\
    Convert a dict to a format that's compatible with WTForm's choices. It also
    optionally prepends a "Please select one..." value.

    Example:
      # Convert this data structure:
      STATUS = OrderedDict([
          ('unread', 'Unread'),
          ('open', 'Open'),
          ('contacted', 'Contacted'),
          ('closed', 'Closed')
      ])

      # Into this:
      choices = [('', 'Please select one...'), ('unread', 'Unread) ...]

    :param source: Input source
    :type source: dict
    :param prepend_blank: An optional blank item
    :type prepend_blank: bool
    :return: list
    r)�append�_�items)�source�
prepend_blank�choices�key�value�pairrrr�choices_from_dictsrcCs:g}|r
|�dtd�f�|D]}||f}|�|�q|S)aJ
    Convert a list to a format that's compatible with WTForm's choices. It also
    optionally prepends a "Please select one..." value.

    Example:
      # Convert this data structure:
      TIMEZONES = (
        'Africa/Abidjan',
        'Africa/Accra',
        'Africa/Addis_Ababa'
      )

      # Into this:
      choices = [('', 'Please select one...'),
                 ('Africa/Abidjan', 'Africa/Abidjan) ...]

    :param source: Input source
    :type source: list or tuple
    :param prepend_blank: An optional blank item
    :type prepend_blank: bool
    :return: list
    rzPlease select one...)rr)rrr�itemrrrr�choices_from_list:sr!N)T)�	flask_wtfr�flask_babelrrrrr!rrrr�<module>s

$