#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# super ( OpenVPNTenantForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# self . fields [ 'kind' ] . widget . attrs [ 'readonly' ] = True #NEWLINE# self . fields [ 'failover_servers' ] . widget . attrs [ 'rows' ] = 300 #NEWLINE# self . fields [ 'provider_service' ] . queryset = OpenVPNService . get_service_objects ( ) . all ( ) #NEWLINE# self . fields [ 'kind' ] . initial = OPENVPN_KIND #NEWLINE# if kwargs . instance : #NEWLINE# #INDENT# self . fields [ 'creator' ] . initial = self . instance . creator #NEWLINE# self . fields [ 'vpn_subnet' ] . initial = self . instance . vpn_subnet #NEWLINE# self . fields [ 'server_network' ] . initial = self . instance . server_network #NEWLINE# self . fields [ 'clients_can_see_each_other' ] . initial = self . instance . clients_can_see_each_other #NEWLINE# self . fields [ 'is_persistent' ] . initial = self . instance . is_persistent #NEWLINE# self . initial [ 'protocol' ] = self . instance . protocol #NEWLINE# self . fields [ 'failover_servers' ] . queryset = OpenVPNTenant . get_tenant_objects ( ) . exclude ( pk = self . instance . pk ) #NEWLINE# self . initial [ 'failover_servers' ] = OpenVPNTenant . get_tenant_objects ( ) . filter ( pk__in = self . instance . failover_server_ids ) #NEWLINE# self . fields [ 'use_ca_from' ] . queryset = OpenVPNTenant . get_tenant_objects ( ) . exclude ( pk = self . instance . pk ) #NEWLINE# if self . instance . use_ca_from_id : #NEWLINE# #INDENT# self . initial [ 'use_ca_from' ] = OpenVPNTenant . get_tenant_objects ( ) . filter ( pk = self . instance . use_ca_from_id ) [ 0 ] #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not self . instance ) or ( not self . instance . pk ) ) : #NEWLINE# #INDENT# self . fields [ 'creator' ] . initial = get_request ( ) . user #NEWLINE# self . fields [ 'vpn_subnet' ] . initial = '255.255.255.0' #NEWLINE# self . fields [ 'server_network' ] . initial = '10.66.77.0' #NEWLINE# self . fields [ 'clients_can_see_each_other' ] . initial = True #NEWLINE# self . fields [ 'is_persistent' ] . initial = True #NEWLINE# self . fields [ 'failover_servers' ] . queryset = OpenVPNTenant . get_tenant_objects ( ) #NEWLINE# if OpenVPNService . get_service_objects ( ) . exists ( ) : #NEWLINE# #INDENT# self . fields [ 'provider_service' ] . initial = OpenVPNService . get_service_objects ( ) . all ( ) [ 0 ]