
    >TfY                         d dl mZ d dlmZ ddlmZ dZ G d dej                  Z G d d	ej	                  Z
 G d
 dej	                  Z G d dej	                  ZdS )    )forms)ColorChoices   )add_blank_choice)BulkEditNullBooleanSelectColorSelect
HTMXSelectSelectWithPKc                   "     e Zd ZdZ fdZ xZS )r   z/
    A Select widget for NullBooleanFields
    c                 H     t                      j        |i | d| _        d S )N))1z	---------)2Yes)3No)super__init__choicesselfargskwargs	__class__s      C/var/www/html/netbox-4.1.3/netbox/utilities/forms/widgets/select.pyr   z"BulkEditNullBooleanSelect.__init__   s,    $)&)))
    __name__
__module____qualname____doc__r   __classcell__r   s   @r   r   r      sB         
 
 
 
 
 
 
 
 
r   r   c                   &     e Zd ZdZdZ fdZ xZS )r   zG
    Extends the built-in Select widget to colorize each <option>.
    zwidgets/colorselect_option.htmlc                 |    t          t                    |d<    t                      j        |i | d| j        d<   d S )Nr   zcolor-selectclass)r   r   r   r   attrsr   s      r   r   zColorSelect.__init__$   sC    ,\::y$)&))),
7r   )r   r   r   r    option_template_namer   r!   r"   s   @r   r   r      sJ          =- - - - - - - - -r   r   c                   $     e Zd ZdZd fd	Z xZS )r	   zb
    Selection widget that will re-generate the HTML form upon the selection of a new option.
    .form_fieldsNc                     |d| d| d}|r|                     |            t                      j        dd|i| d S )N#)zhx-getz
hx-includez	hx-targetr&    )updater   r   )r   hx_urlhx_target_idr&   r   _attrsr   s         r   r   zHTMXSelect.__init__.   sl    ,l,,+\++
 

  	!MM%   00v000000r   )r)   r*   Nr   r"   s   @r   r	   r	   *   sG         	1 	1 	1 	1 	1 	1 	1 	1 	1 	1r   r	   c                       e Zd ZdZdZdS )r
   z]
    Include the primary key of each option in the option label (e.g. "Router7 (4721)").
    z"widgets/select_option_with_pk.htmlN)r   r   r   r    r'   r-   r   r   r
   r
   :   s#          @r   r
   N)djangor   netbox.choicesr   utilsr   __all__NullBooleanSelectr   Selectr   r	   r
   r-   r   r   <module>r9      s         ' ' ' ' ' ' $ $ $ $ $ $
 
 
 
 
 7 
 
 
 	- 	- 	- 	- 	-%, 	- 	- 	-1 1 1 1 1 1 1 1 @ @ @ @ @5< @ @ @ @ @r   