<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from django . core . exceptions import ValidationError <EOL> from django . forms import fields , widgets <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from . dk_municipalities import DK_MUNICIPALITIES <EOL> from . dk_postalcodes import DK_POSTALCODES <EOL> def postal_code_validator ( value ) : <EOL> if value not in [ zip for zip , city in DK_POSTALCODES ] : <EOL> raise ValidationError ( _ ( '<STR_LIT>' ) ) <EOL> class DKPostalCodeField ( fields . CharField ) : <EOL> """<STR_LIT>""" <EOL> default_validators = [ postal_code_validator ] <EOL> class DKMunicipalitySelect ( widgets . Select ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , attrs = None , * args , ** kwargs ) : <EOL> super ( DKMunicipalitySelect , self ) . __init__ ( <EOL> attrs , <EOL> choices = DK_MUNICIPALITIES , <EOL> * args , <EOL> ** kwargs <EOL> ) <EOL> class DKPhoneNumberField ( fields . RegexField ) : <EOL> """<STR_LIT>""" <EOL> default_error_messages = { <EOL> '<STR_LIT>' : _ ( <EOL> '<STR_LIT>' <EOL> ) , <EOL> } <EOL> def __init__ ( self , max_length = None , min_length = None , * args , ** kwargs ) : <EOL> super ( DKPhoneNumberField , self ) . __init__ ( <EOL> r'<STR_LIT>' , <EOL> max_length , <EOL> min_length , <EOL> * args , <EOL> ** kwargs <EOL> ) </s>
