<s> '''<STR_LIT>''' <EOL> from django import forms <EOL> from vt_plugin . models import VtPlugin <EOL> from expedient . common . utils import create_or_update <EOL> from django . forms . models import ModelChoiceField <EOL> from vt_plugin . models import xmlrpcServerProxy <EOL> class VTAggregateForm ( forms . ModelForm ) : <EOL> '''<STR_LIT>''' <EOL> class Meta : <EOL> model = VtPlugin <EOL> exclude = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class xmlrpcServerProxyForm ( forms . ModelForm ) : <EOL> '''<STR_LIT>''' <EOL> confirm_password = forms . CharField ( <EOL> help_text = "<STR_LIT>" , <EOL> max_length = <NUM_LIT> , <EOL> widget = forms . PasswordInput ( render_value = False ) ) <EOL> def __init__ ( self , check_available = False , * args , ** kwargs ) : <EOL> super ( xmlrpcServerProxyForm , self ) . __init__ ( * args , ** kwargs ) <EOL> self . check_available = check_available <EOL> self . fields [ '<STR_LIT:username>' ] . widget . attrs [ "<STR_LIT>" ] = '<STR_LIT>' <EOL> self . fields [ '<STR_LIT:password>' ] . widget . attrs [ "<STR_LIT>" ] = '<STR_LIT>' <EOL> self . fields [ '<STR_LIT>' ] . widget . attrs [ "<STR_LIT>" ] = '<STR_LIT>' <EOL> class Meta : <EOL> model = xmlrpcServerProxy <EOL> fields = ( '<STR_LIT:username>' , '<STR_LIT:password>' , '<STR_LIT>' , '<STR_LIT:url>' ) <EOL> widgets = { <EOL> '<STR_LIT:password>' : forms . PasswordInput ( render_value = True ) , <EOL> } <EOL> def clean ( self ) : <EOL> password = self . cleaned_data . get ( '<STR_LIT:password>' , None ) <EOL> confirm_password = self . cleaned_data . get ( '<STR_LIT>' , None ) <EOL> if password and confirm_password and ( password != confirm_password ) : <EOL> raise forms . ValidationError ( "<STR_LIT>" ) <EOL> d = dict ( self . cleaned_data ) <EOL> if "<STR_LIT>" in d : <EOL> del d [ "<STR_LIT>" ] <EOL> p = self . _meta . model ( ** d ) <EOL> return self . cleaned_data </s>
