def validate_connection_status(value):
 if (value.lower() not in ['planned', 'connected']):
  raise ValidationError('Invalid connection status ({}); must be either "planned" or "connected".'.format(value))

def validate_connection_status ( value ) : if ( value . lower ( ) not in [ 'planned' , 'connected' ] ) : raise ValidationError ( 'Invalid connection status ({}); must be either "planned" or "connected".' . format ( value ) )
custom validator for connection statuses .