#@staticmethod
def fetch_uptime_kuma(self):
"""
Fetch all data from the virtual Doctype 'Uptime Kuma'.
"""
try:
# Call the get_list method of UptimeKuma to fetch data
data = UptimeKuma.get_list()
# frappe.errprint("data fetched successfully")
# return data
formatted_data = {
"columns": [{"fieldname":"uptime_kuma_name","label":"Uptime Kuma","fieldtype":"Data"}],
"rows": [{"uptime_kuma_name":d["uptime_kuma_name"]} for d in data],
}
return formatted_data
except Exception as e:
frappe.log_error(f"Error in fetch_uptime_kuma_data: {str(e)}")
return {"error": f"Unable to fetch data: {str(e)}"}
I have created a custom app called ‘license,’ and within it, a virtual Doctype named ‘Uptime Kuma.’ I have also created a custom function in the Python file of this Doctype. I want to use this function in Insights, but it throws the following error: insights.api.workbooks.fetch_query_results IbisError
."
simply how to use virtual doctype values in insights.