2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 07:08:36 +00:00
books/model/models.js
2018-01-12 17:55:07 +05:30

25 lines
558 B
JavaScript

const process = require('process');
const frappe = require('frappe-core');
class Models {
constructor() {
this.data = {doctype: {}};
this.controllers = {};
this.meta_classes = {};
}
get(doctype, name) {
return this.data[frappe.slug(doctype)][frappe.slug(name)];
}
get_controller(doctype) {
return this.controllers[frappe.slug(doctype)];
}
get_meta_class(doctype) {
return this.meta_classes[frappe.slug(doctype)] || frappe.meta.Meta;
}
}
module.exports = { Models: Models }