mirror of
https://github.com/frappe/books.git
synced 2025-01-03 15:17:30 +00:00
typo
This commit is contained in:
parent
80699c833a
commit
6d66347377
15
README.md
15
README.md
@ -42,7 +42,6 @@ Models are declared by adding a `.json` model file in the `models/doctype` folde
|
|||||||
### Setup / Migrate
|
### Setup / Migrate
|
||||||
|
|
||||||
const frappe = require('frappe-core);
|
const frappe = require('frappe-core);
|
||||||
|
|
||||||
frappe.init();
|
frappe.init();
|
||||||
|
|
||||||
// sync all schema from `models` folders in all apps
|
// sync all schema from `models` folders in all apps
|
||||||
@ -50,7 +49,9 @@ Models are declared by adding a `.json` model file in the `models/doctype` folde
|
|||||||
|
|
||||||
### Managing Documents
|
### Managing Documents
|
||||||
|
|
||||||
Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, delete) documents based on the DocTypes declared
|
Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, delete) documents based on the DocTypes declared.
|
||||||
|
|
||||||
|
Documents are stored in SQLite using `sql.js`
|
||||||
|
|
||||||
#### Create
|
#### Create
|
||||||
|
|
||||||
@ -58,8 +59,8 @@ Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, de
|
|||||||
frappe.init();
|
frappe.init();
|
||||||
|
|
||||||
// make a new todo
|
// make a new todo
|
||||||
let todo = frappe.get_doc({doctype: 'ToDo', subject: 'something'})
|
let todo = frappe.get_doc({doctype: 'ToDo', subject: 'something'});
|
||||||
todo.insert()
|
todo.insert();
|
||||||
|
|
||||||
#### Read
|
#### Read
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, de
|
|||||||
|
|
||||||
// get all open todos
|
// get all open todos
|
||||||
let todos = frappe.db.get_all('ToDo', ['name'], {status: "Open"});
|
let todos = frappe.db.get_all('ToDo', ['name'], {status: "Open"});
|
||||||
let first_todo = frappe.get_doc('ToDo', toods.name);
|
let first_todo = frappe.get_doc('ToDo', toods[0].name);
|
||||||
|
|
||||||
|
|
||||||
#### Update
|
#### Update
|
||||||
@ -78,7 +79,7 @@ Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, de
|
|||||||
|
|
||||||
// get all open todos
|
// get all open todos
|
||||||
let todos = frappe.db.get_all('ToDo', ['name'], {status: "Open"});
|
let todos = frappe.db.get_all('ToDo', ['name'], {status: "Open"});
|
||||||
let first_todo = frappe.get_doc('ToDo', toods.name);
|
let first_todo = frappe.get_doc('ToDo', toods[0].name);
|
||||||
|
|
||||||
first_todo.status = 'Closed';
|
first_todo.status = 'Closed';
|
||||||
first_todo.update();
|
first_todo.update();
|
||||||
@ -86,7 +87,6 @@ Frappe Object-Relational-Mapper (ORM) helps you manage (create, read, update, de
|
|||||||
### Metadata
|
### Metadata
|
||||||
|
|
||||||
const frappe = require('frappe-core);
|
const frappe = require('frappe-core);
|
||||||
|
|
||||||
frappe.init();
|
frappe.init();
|
||||||
|
|
||||||
let todo_meta = frappe.get_meta('ToDo');
|
let todo_meta = frappe.get_meta('ToDo');
|
||||||
@ -118,7 +118,6 @@ The name of the class must be the slugged name of the DocType
|
|||||||
You can also directly write SQL with `frappe.db.sql`
|
You can also directly write SQL with `frappe.db.sql`
|
||||||
|
|
||||||
const frappe = require('frappe-core);
|
const frappe = require('frappe-core);
|
||||||
|
|
||||||
frappe.init();
|
frappe.init();
|
||||||
|
|
||||||
all_todos = frappe.db.sql('select name from todo');
|
all_todos = frappe.db.sql('select name from todo');
|
||||||
|
Loading…
Reference in New Issue
Block a user