def get_creation_count(self, doctype, minutes):
		from frappe.utils import now_datetime
		from dateutil.relativedelta import relativedelta

		return frappe.db.sql("""select count(name) from `tab{doctype}`
			where creation >= %s""".format(doctype=doctype),
			now_datetime() - relativedelta(minutes=minutes))[0][0]
Ensure POSTing with a readonly scope instead of a write scope fails
dataset/ETHPy150Open frappe/frappe/frappe/database.py/Database.get_creation_count--crossover with--dataset/ETHPy150Open jlafon/django-rest-framework-oauth/tests/test_oauth.py/OAuthTests.test_get_form_with_readonly_resource_passing_auth