How to get a list of all doctypes that are present in the system?

I am trying to generate a report to see which DocType items are being created/edited on a daily basis.

For this, how can I fetch a list of all the DocTypes?

frappe.get_list("Doctype")

This will give a list of all doctypes on the site. Doctype is also a doctype.

2 Likes

An alternate solution is to run SQL query and get all the tables in db which start with tab.

sql = '''
SELECT table_name 
FROM information_schema.tables
WHERE
table_type = 'BASE TABLE';
'''
tables = frappe.db.sql(sql)
2 Likes