def to_json_value(obj, fieldname, value=_marker, default=None):
<EOL>if value is _marker:<EOL><INDENT>value = IDataManager(obj).json_data(fieldname)<EOL><DEDENT>if isinstance(value, ImplicitAcquisitionWrapper):<EOL><INDENT>return get_url_info(value)<EOL><DEDENT>if callable(value):<EOL><INDENT>value = value()<EOL><DEDENT>if is_date(value):<EOL><INDENT>return to_iso_date(value)<EOL><DEDENT>if not is_json_serializable(value):<EOL><INDENT>logger.warn("<STR_LIT>".format(repr(value)))<EOL>return default<EOL><DEDENT>return value<EOL>
JSON save value encoding

    :param obj: Content object
    :type obj: ATContentType/DexterityContentType
    :param fieldname: Schema name of the field
    :type fieldname: str/unicode
    :param value: The field value
    :type value: depends on the field type
    :returns: JSON encoded field value
    :rtype: field dependent