Hello everyone
I’ve come across a few frappe calls, that are currently not listed in the developer cheat sheet. So I would like to inquire about what exactly they do and what they are for.
First off is frappe._dict()
Usually you see something like items = frappe._dict()
This seems to be used to create and modify dictionaries. However, why would one use this instead of the regular python way of creating dictionaries? items = {}
The other one is frappe.db.escape
I assume that this one is somehow used to escape certain characters.
I have used frappe.db.escape to escape special character.
You are right it is used to escape special characters. If there is some data in your table in which name contains ’ or " and you are using that in your query. It will raise fatal error when query fires. To avoid that we use frappe.db.escape. About frappe._dict() i have no idea as i haven’t use it yet.