#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# if ( 'widget' not in kwargs ) : #NEWLINE# #INDENT# attrs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( PASSWORD_MIN_LENGTH and PASSWORD_MAX_LENGTH ) : #NEWLINE# #INDENT# attrs [ 'pattern' ] = ( '.{%i,%i}' % ( PASSWORD_MIN_LENGTH , PASSWORD_MAX_LENGTH ) ) #NEWLINE# attrs [ 'title' ] = ( _ ( '%i to %i characters' ) % ( PASSWORD_MIN_LENGTH , PASSWORD_MAX_LENGTH ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if PASSWORD_MIN_LENGTH : #NEWLINE# #INDENT# attrs [ 'pattern' ] = ( '.{%i,}' % PASSWORD_MIN_LENGTH ) #NEWLINE# attrs [ 'title' ] = ( _ ( '%i characters minimum' ) % PASSWORD_MIN_LENGTH ) #NEWLINE# #UNINDENT# #UNINDENT# if PASSWORD_MAX_LENGTH : #NEWLINE# #INDENT# attrs [ 'maxlength' ] = PASSWORD_MAX_LENGTH #NEWLINE# #UNINDENT# kwargs [ 'widget' ] = PasswordInput ( render_value = False , attrs = attrs ) #NEWLINE# #UNINDENT# super ( PasswordField , self ) . __init__ ( * attrs , ** kwargs )