def default_encode(v):
    """convert ObjectId, datetime, date into string
    """
    if isinstance(v, ObjectId):
        return unicode_type(v)

    if isinstance(v, datetime):
        return format_time(v)

    if isinstance(v, date):
        return format_time(v)

    return v