ห
    %i  ใ                   ๓v    d Z  G d deซ      Z G d deซ      Z G d deซ      Z G d deซ      Z G d	 d
eซ      Zy)z,Classes for class-based forward declaration.c                   ๓&    e Zd ZdZed ซ       Zd Zy)ฺForwardz0Base class for autocomplete forward declaration.c                 ๓    t        dซ      )z2Forward type. Should be implemented in subclasses.zPlease use one of my subclasses)ฺNotImplementedErrorฉฺselfs    ๚e/var/www/html/navyabakers_fullstack/navyabakers_prod/venv/lib/python3.12/site-packages/dal/forward.pyฺtypezForward.type   s    ๔ "ะ"CำDะD๓    c                 ๓    d| j                   iS )๚5Convert to dictionary which will be rendered as JSON.r	   )r	   r   s    r   ฺto_dictzForward.to_dict   s    ๐ DII๐
๐ 	
r
   N)ฺ__name__ฺ
__module__ฺ__qualname__ฺ__doc__ฺpropertyr	   r   ฉ r
   r   r   r      s    ู:เ๑E๓ ๐E๓
r
   r   c                   ๓.     e Zd ZdZdZddZ fdZ xZS )ฺFieldaก  Forward field value.

    The type of the forwarded value from the field is either string, list of
    strings or boolean.

    The following rules are used to deduce the forwarded type.

     - If there is only one field in the form or subform with name ``src``
    and this field is a checkbox without ``value`` HTML-attribute,
    then boolean value indicating if this checkbox is checked is forwarded.

     - If there is only one field in the form or subform with name ``src``
    and it has ``multiple`` HTML-attribute, then this field is forwarded as a
    list of strings, containing values from this field.

    - If there are one or more fields in the form with name ``src`` and all of
    them are checkboxes with HTML-attribute ``value`` set the list of strings
    containing checked checkboxes is forwarded.

    - Otherwise ``src`` field value forwarded as a string.

    .. py:attribute:: src

        The name of the form field whose value will be forwarded to a view.

    .. py:attribute:: dst

        The name of the key of the forwarded value from the src field in the
        forwarded dictionary. If this value is ``None``, then the key is
        ``src``.
    ฺfieldc                 ๓     || _         || _        yฉz$Instantiate a forwarded field value.N)ฺsrcฺdst)r   r   r   s      r   ฺ__init__zField.__init__6   ๓    เุr
   c                 ๓ด    t         t        |   ซ       }|j                  | j                  ฌซ       | j
                  |j                  | j
                  ฌซ       |S )r   )r   ฉr   )ฺsuperr   r   ฺupdater   r   ฉr   ฺdฺ	__class__s     r   r   zField.to_dict;   sE   ๘ ไ%ั&ำ(เ	TXXิุ88ะุHHHิ"เr
   ฉNฉr   r   r   r   r	   r   r   ฺ__classcell__ฉr#   s   @r   r   r      s   ๘ ๑๐@ D๓๗
๐ r
   r   c                   ๓,     e Zd ZdZdZd Z fdZ xZS )ฺConstzหForward arbitrary constant value.

    .. py:attribute:: val

        The value to forward. Must be JSON-serializable.

    .. py:attribute:: dst

        The name of the key of the forwarded value.
    ฺconstc                 ๓     || _         || _        y)z'Instantiate a forwarded constant value.N)ฺvalr   )r   r,   r   s      r   r   zConst.__init__T   r   r
   c                 ๓    t         t        |   ซ       }|j                  | j                  ฌซ       |j                  | j
                  ฌซ       |S )r   )r,   r   )r   r)   r   r    r,   r   r!   s     r   r   zConst.to_dictY   s;   ๘ ไ%ั&ำ(เ	TXXิุ	TXXิเr
   r%   r'   s   @r   r)   r)   F   s   ๘ ๑	๐ D๒๗
๐ r
   r)   c                   ๓.     e Zd ZdZdZddZ fdZ xZS )ฺ
JavaScriptaH  Run registered javascript handler and forward its returned value.

    You can register custom forward handler in your JS code as follows:

    .. code-block:: javascript

    yl.registerForwardHandler("your_handler", function (autocompleteElement) {
        // your code here
    });

    Then if your add ``JavaScript("your_handler", "some_value")`` to your
    forwards declaration, your function will be called, autocomplete field
    HTML element will be passed as ``autocompleteElement`` and returned value
    will be added to forward dictionary with ``some_value`` key.

    .. py:attribute:: handler

    The name of the registered handler.

    .. py:attribute:: dst

    The name of the key of the forwarded value from the src field in the
    forwarded dictionary. If this value is ``None``, then the key is
    ``handler``
    ฺ
javascriptc                 ๓     || _         || _        y)zInitialize Javascript class.N)ฺhandlerr   )r   r2   r   s      r   r   zJavaScript.__init__   s    เุr
   c                 ๓    t         t        |   ซ       }|j                  | j                  ฌซ       |j                  | j
                  ฌซ       |S )r   )r2   r   )r   r/   r   r    r2   r   r!   s     r   r   zJavaScript.to_dict   s;   ๘ ไ*dั+ำ-เ	ิ&ุ	TXXิเr
   r$   r%   r'   s   @r   r/   r/   c   s   ๘ ๑๐4 D๓๗
๐ r
   r/   c                   ๓.     e Zd ZdZdZddZ fdZ xZS )ฺSelfa#  Forward own value.

    The same as :class:`Field`, except that `src` is always this field
    itself.

    .. py:attribute:: dst

    The name of the key of the forwarded value from the src field in the
    forwarded dictionary. If this value is ``None``, then the key is
    ``self``.
    r   c                 ๓    || _         yr   r   )r   r   s     r   r   zSelf.__init__   s	    เr
   c                 ๓|    t         t        |   ซ       }| j                  |j	                  | j                  ฌซ       |S )r   r   )r   r5   r   r   r    r!   s     r   r   zSelf.to_dictข   s3   ๘ ไ$ั%ำ'เ88ะุHHHิ"เr
   r$   r%   r'   s   @r   r5   r5      s   ๘ ๑
๐ D๓๗๐ r
   r5   N)r   ฺobjectr   r   r)   r/   r5   r   r
   r   ๚<module>r9      sF   ๐ู 2๔
f๔ 
๔0G๔ 0๔fG๔ ๔:)๔ )๔X7๕ r
   