2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 23:28:24 +00:00
books/docs/models/metadata.md

12 lines
349 B
Markdown
Raw Normal View History

2018-01-10 18:19:52 +05:30
# Metadata
2018-02-08 17:58:51 +05:30
Metadata are first class objects in Frappe.js. You can get a metadata object by `frappe.getMeta`. All objects from the `models` folders of all modules are loaded.
2018-01-10 18:19:52 +05:30
### Example
```js
2018-02-08 17:58:51 +05:30
let todo_meta = frappe.getMeta('ToDo');
2018-01-10 18:19:52 +05:30
// get all fields of type "Data"
let data_fields = todo_meta.fields.map(d => d.fieldtype=='Data' ? d : null);
```