2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 20:18:26 +00:00
books/model/models.js

25 lines
558 B
JavaScript
Raw Normal View History

2018-01-12 17:55:07 +05:30
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 }