<s> """<STR_LIT>""" <EOL> from django . forms . fields import RegexField , Select <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from . jp_prefectures import JP_PREFECTURE_CODES , JP_PREFECTURES <EOL> class JPPostalCodeField ( RegexField ) : <EOL> """<STR_LIT>""" <EOL> default_error_messages = { <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> } <EOL> def __init__ ( self , max_length = None , min_length = None , * args , ** kwargs ) : <EOL> super ( JPPostalCodeField , self ) . __init__ ( r'<STR_LIT>' , <EOL> max_length , min_length , * args , ** kwargs ) <EOL> def clean ( self , value ) : <EOL> """<STR_LIT>""" <EOL> value = super ( JPPostalCodeField , self ) . clean ( value ) <EOL> return value . replace ( '<STR_LIT:->' , '<STR_LIT>' ) <EOL> class JPPrefectureSelect ( Select ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , attrs = None ) : <EOL> super ( JPPrefectureSelect , self ) . __init__ ( attrs , choices = JP_PREFECTURES ) <EOL> class JPPrefectureCodeSelect ( Select ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , attrs = None ) : <EOL> super ( JPPrefectureCodeSelect , self ) . __init__ ( attrs , choices = JP_PREFECTURE_CODES ) </s>
