
    >Tf=                         d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ dZ G d d	ee
          Z G d
 dee
          Z G d de
          ZdS )    )models)Q)reverse)gettext_lazy)PrimaryModel)ContactsMixin)ProviderNetworkProviderProviderAccountc                       e Zd ZdZ ej         ed          dd ed                    Z ej         ed          dd          Z	 ej
        d	d
d          ZdZ G d d          Zd Zd ZdS )r
   z
    Each Circuit belongs to a Provider. This is usually a telecommunications company or similar organization. This model
    stores information pertinent to the user's relationship with the Provider.
    named   TzFull name of the provider)verbose_name
max_lengthunique	help_textslug)r   r   r   zipam.ASN	providers)torelated_nameblank c                   @    e Zd ZdgZ ed          Z ed          ZdS )Provider.Metar   providerr   N)__name__
__module____qualname__ordering_r   verbose_name_pluralr       >/var/www/html/netbox-4.1.3/netbox/circuits/models/providers.pyMetar   (   s2        8q}}annr"   r$   c                     | j         S Nr   selfs    r#   __str__zProvider.__str__-   
    yr"   c                 0    t          d| j        g          S )Nzcircuits:providerargsr   pkr(   s    r#   get_absolute_urlzProvider.get_absolute_url0   s    *$';;;;r"   N)r   r   r   __doc__r   	CharFieldr    r   	SlugFieldr   ManyToManyFieldasnsclone_fieldsr$   r*   r1   r   r"   r#   r
   r
      s          6QvYY!/00	  D 6QvYY  D
 "6!   D L- - - - - - - -
  < < < < <r"   r
   c                       e Zd ZdZ ej        dej        d          Z ej        d e	d                    Z
 ej         e	d          dd	
          ZdZ G d d          Zd Zd ZdS )r   zd
    This is a discrete account within a provider.  Each Circuit belongs to a Provider Account.
    circuits.Provideraccountsr   	on_deleter   r   z
account ID)r   r   r   T)r   r   r   )r   c                       e Zd ZdZ ej        dd           ej        dd ed                     fZ ed	          Z	 ed
          Z
dS )ProviderAccount.Meta)r   accountz/%(app_label)s_%(class)s_unique_provider_accountfieldsr   r   r   ,%(app_label)s_%(class)s_unique_provider_name r'   )rA   r   	conditionzprovider accountzprovider accountsN)r   r   r   r   r   UniqueConstraintr   constraintsr    r   r!   r   r"   r#   r$   r>   I   s        *#F#.F   $F#+C1":::+  

 q+,,a 344r"   r$   c                 D    | j         r| j         d| j          dS | j         S )Nz ())r   r?   r(   s    r#   r*   zProviderAccount.__str__Y   s2    9 	3l22di2222,  r"   c                 0    t          d| j        g          S )Nzcircuits:provideraccountr-   r/   r(   s    r#   r1   z ProviderAccount.get_absolute_url^       1	BBBBr"   N)r   r   r   r2   r   
ForeignKeyPROTECTr   r3   r    r?   r   r7   r$   r*   r1   r   r"   r#   r   r   4   s          !v .  H
 fQ|__  G 6QvYY  D "L5 5 5 5 5 5 5 5 ! ! !
C C C C Cr"   r   c                       e Zd ZdZ ej         ed          d          Z ej        dej	        d          Z
 ej        dd ed	          
          Z G d d          Zd Zd ZdS )r	   z
    This represents a provider network which exists outside of NetBox, the details of which are unknown or
    unimportant to the user.
    r   r   )r   r   r9   networksr;   Tz
service ID)r   r   r   c                   d    e Zd ZdZ ej        dd          fZ ed          Z ed          Z	dS )ProviderNetwork.MetarB   rC   r@   zprovider networkzprovider networksN)
r   r   r   r   r   rF   rG   r    r   r!   r   r"   r#   r$   rQ   v   s\        '#F#+C  
 q+,,a 344r"   r$   c                     | j         S r&   r'   r(   s    r#   r*   zProviderNetwork.__str__   r+   r"   c                 0    t          d| j        g          S )Nzcircuits:providernetworkr-   r/   r(   s    r#   r1   z ProviderNetwork.get_absolute_url   rK   r"   N)r   r   r   r2   r   r3   r    r   rL   rM   r   
service_idr$   r*   r1   r   r"   r#   r	   r	   b   s          6QvYY  D !v .  H
 "!Q|__  J	5 	5 	5 	5 	5 	5 	5 	5  C C C C Cr"   r	   N)	django.dbr   django.db.modelsr   django.urlsr   django.utils.translationr   r    netbox.modelsr   netbox.models.featuresr   __all__r
   r   r	   r   r"   r#   <module>r\      s                     6 6 6 6 6 6 & & & & & & 0 0 0 0 0 0!< !< !< !< !<}l !< !< !<H+C +C +C +C +Cm\ +C +C +C\#C #C #C #C #Cl #C #C #C #C #Cr"   