mirror of
https://github.com/frappe/books.git
synced 2024-11-13 00:46:28 +00:00
24 lines
412 B
Markdown
24 lines
412 B
Markdown
|
# Frappe Core
|
||
|
|
||
|
Core libs for Frappe Framework JS
|
||
|
|
||
|
### Examples
|
||
|
|
||
|
const frappe = require('frappe-core);
|
||
|
|
||
|
# init database
|
||
|
frappe.init();
|
||
|
|
||
|
# make a new todo
|
||
|
let todo = frappe.get_doc({doctype: 'ToDo', subject: 'something'})
|
||
|
todo.insert()
|
||
|
|
||
|
# get all todos
|
||
|
let total_open = 0;
|
||
|
for (let d of frappe.get_all('ToDo')) {
|
||
|
todo = frappe.get_doc('ToDo', d.name);
|
||
|
if (todo.status == 'Open') total_open += 1;
|
||
|
}
|
||
|
|
||
|
|