def count(self, dt, filters=None, debug=False):
		if filters:
			conditions, filters = self.build_conditions(filters)
			return frappe.db.sql("""select count(*)
				from `tab%s` where %s""" % (dt, conditions), filters, debug=debug)[0][0]
		else:
			return frappe.db.sql("""select count(*)
				from `tab%s`""" % (dt,))[0][0]
Returns `COUNT(*)` for given DocType and filters.
dataset/ETHPy150Open frappe/frappe/frappe/database.py/Database.count