def _get_truncated_setting_value(value, max_length=None):
 if (isinstance(value, basestring) and (max_length is not None) and (len(value) > max_length)):
  return (value[0:max_length], True)
 else:
  return (value, False)

def _get_truncated_setting_value ( value , max_length = None ) : if ( isinstance ( value , basestring ) and ( max_length is not None ) and ( len ( value ) > max_length ) ) : return ( value [ 0 : max_length ] , True ) else : return ( value , False )
returns the truncated form of a setting value .