
    >Tf                        d dl mZ d dlmZ d dlmZmZmZm	Z	 d dl
T 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 G d dej                  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 G d dej                  ZdS )    )forms)gettext_lazy)InterfacePoEModeChoicesInterfacePoETypeChoicesInterfaceTypeChoicesPortTypeChoices)*)WirelessRoleChoices)
ConsolePortTemplateImportForm#ConsoleServerPortTemplateImportFormDeviceBayTemplateImportFormFrontPortTemplateImportFormInterfaceTemplateImportFormInventoryItemTemplateImportFormModuleBayTemplateImportFormPowerOutletTemplateImportFormPowerPortTemplateImportFormRearPortTemplateImportFormc                   (    e Zd Z G d d          ZdS )r   c                       e Zd ZeZg dZdS )"ConsolePortTemplateImportForm.Metadevice_typemodule_typenamelabeltypedescriptionN)__name__
__module____qualname__ConsolePortTemplatemodelfields     =/var/www/html/netbox-4.1.3/netbox/dcim/forms/object_import.pyMetar      $        #
 
 
r&   r(   Nr   r    r!   r(   r%   r&   r'   r   r      <        
 
 
 
 
 
 
 
 
 
r&   r   c                   (    e Zd Z G d d          ZdS )r   c                       e Zd ZeZg dZdS )(ConsoleServerPortTemplateImportForm.Metar   N)r   r    r!   ConsoleServerPortTemplater#   r$   r%   r&   r'   r(   r.   %   s$        )
 
 
r&   r(   Nr*   r%   r&   r'   r   r   #   r+   r&   r   c                   (    e Zd Z G d d          ZdS )r   c                       e Zd ZeZg dZdS ) PowerPortTemplateImportForm.Meta)r   r   r   r   r   maximum_drawallocated_drawr   N)r   r    r!   PowerPortTemplater#   r$   r%   r&   r'   r(   r2   .   $        !
 
 
r&   r(   Nr*   r%   r&   r'   r   r   ,   r+   r&   r   c                       e Zd Z ej         ed          ej                                        dd          Z	 G d d          Z
d Zd Zd	S )
r   z
Power portr   Fr   querysetto_field_namerequiredc                       e Zd ZeZg dZdS )"PowerOutletTemplateImportForm.Meta)r   r   r   r   r   
power_portfeed_legr   N)r   r    r!   PowerOutletTemplater#   r$   r%   r&   r'   r(   r=   =   r)   r&   r(   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   r>   r   cleaned_datar$   r9   filter)selfr   r>   s      r'   clean_device_typez/PowerOutletTemplateImportForm.clean_device_typeC   F    +M::; 	V\2J","5"<"<"<"U"UJr&   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   r>   r   rC   )rF   r   r>   s      r'   clean_module_typez/PowerOutletTemplateImportForm.clean_module_typeJ   rH   r&   N)r   r    r!   r   ModelChoiceField_r5   objectsallr>   r(   rG   rK   r%   r&   r'   r   r   5   s        ''aoo"*..00	  J
 
 
 
 
 
 
 
      r&   r   c                      e Zd Z ej         ed          ej                  Z ej        e	d ed                    Z
 ej        ed ed                    Z ej        ed ed                    Z G d d	          Zd
S )r   Typer   choicesFzPoE mode)rS   r;   r   zPoE typezWireless rolec                       e Zd ZeZg dZdS ) InterfaceTemplateImportForm.Meta)r   r   r   r   r   enabled	mgmt_onlyr   poe_modepoe_typerf_roleN)r   r    r!   InterfaceTemplater#   r$   r%   r&   r'   r(   rU   g   s$        !
 
 
r&   r(   N)r   r    r!   r   ChoiceFieldrM   r   CHOICESr   r   rX   r   rY   r
   rZ   r(   r%   r&   r'   r   r   R   s        5aii$,  D !u 'a
mm  H
 !u 'a
mm  H
  e#a    G
 
 
 
 
 
 
 
 
 
r&   r   c                       e Zd Z ej         ed          ej                  Z ej	         ed          e
j                                        d          Zd Zd Z G d d	          Zd
S )r   rQ   rR   z	Rear portr   )r   r9   r:   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   	rear_portrB   rC   )rF   r   r`   s      r'   rG   z-FrontPortTemplateImportForm.clean_device_typez   F    +M::; 	TK0I!*!3!:!:{!:!S!SIr&   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   r`   rJ   rC   )rF   r   r`   s      r'   rK   z-FrontPortTemplateImportForm.clean_module_type   ra   r&   c                       e Zd ZeZg dZdS ) FrontPortTemplateImportForm.Meta)	r   r   r   r   colorr`   rear_port_positionr   r   N)r   r    r!   FrontPortTemplater#   r$   r%   r&   r'   r(   rd      r6   r&   r(   N)r   r    r!   r   r\   rM   r   r]   r   rL   RearPortTemplaterN   rO   r`   rG   rK   r(   r%   r&   r'   r   r   o   s        5aii'  D '&ann!)--//  I    
 
 
 
 
 
 
 
 
 
r&   r   c                   h    e Zd Z ej         ed          ej                  Z G d d          Z	dS )r   rQ   rR   c                       e Zd ZeZg dZdS )RearPortTemplateImportForm.Meta)r   r   r   r   re   	positionsr   r   N)r   r    r!   rh   r#   r$   r%   r&   r'   r(   rk      s$         
 
 
r&   r(   N)
r   r    r!   r   r\   rM   r   r]   r   r(   r%   r&   r'   r   r      sf        5aii'  D

 
 
 
 
 
 
 
 
 
r&   r   c                   (    e Zd Z G d d          ZdS )r   c                       e Zd ZeZg dZdS ) ModuleBayTemplateImportForm.Meta)r   r   r   positionr   N)r   r    r!   ModuleBayTemplater#   r$   r%   r&   r'   r(   ro      r6   r&   r(   Nr*   r%   r&   r'   r   r      r+   r&   r   c                   (    e Zd Z G d d          ZdS )r   c                       e Zd ZeZg dZdS ) DeviceBayTemplateImportForm.Meta)r   r   r   r   N)r   r    r!   DeviceBayTemplater#   r$   r%   r&   r'   r(   rt      r6   r&   r(   Nr*   r%   r&   r'   r   r      r+   r&   r   c                   j   e Zd Z ej         ed          ej                                        d          Z	 ej         ed          e
j                                        dd          Z ej         ed          ej                                        dd          Z G d d	          Zd
 Zd ZdS )r   ParentF)r   r9   r;   Roler   r8   Manufacturerc                       e Zd ZeZg dZdS )$InventoryItemTemplateImportForm.Meta)r   parentr   r   rolemanufacturerpart_idr   N)r   r    r!   InventoryItemTemplater#   r$   r%   r&   r'   r(   r{      s$        %
 
 
r&   r(   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   r|   rB   rC   )rF   r   r|   s      r'   rG   z1InventoryItemTemplateImportForm.clean_device_type   D    +M::; 	N[*F$o444MMFOr&   c                 ~    | j         d         x}r-| j        d         }|j                            |          |_        |S )Nr   r|   rJ   rC   )rF   r   r|   s      r'   rK   z1InventoryItemTemplateImportForm.clean_module_type   r   r&   N)r   r    r!   r   rL   rM   r   rN   rO   r|   InventoryItemRoler}   ry   r~   r(   rG   rK   r%   r&   r'   r   r      s       #U#akk&.2244  F
 "5!aii"*..00	  D *5)a%))++	  L
 
 
 
 
 
 
 
      r&   r   N)djangor   django.utils.translationr   rM   dcim.choicesr   r   r   r   dcim.modelswireless.choicesr
   __all__	ModelFormr   r   r   r   r   r   r   r   r   r   r%   r&   r'   <module>r      s5         6 6 6 6 6 6 p p p p p p p p p p p p     0 0 0 0 0 0$
 
 
 
 
EO 
 
 

 
 
 
 
%/ 
 
 

 
 
 
 
%/ 
 
 
    EO   :
 
 
 
 
%/ 
 
 
:
 
 
 
 
%/ 
 
 
@

 

 

 

 

 

 

 


 
 
 
 
%/ 
 
 

 
 
 
 
%/ 
 
 
% % % % %eo % % % % %r&   