class EmbeddedModuleModal(db.EmbeddedDocument): _id = db.ObjectIdField() module_name = db.StringField() order = db.IntField(unique_with='module_name') sub_modules = db.SortedListField(db.EmbeddedDocumentField(SubModule), ordering="sub_order", reverse=False)
class ProjectModel(db.Document): _id = db.ObjectIdField() project_id = db.IntField() title = db.StringField() text = db.StringField() test = db.StringField() meta = {"collection": "project", "strict": "False"}
class ModuleModel(db.Document): _id = db.ObjectIdField() module_name = db.StringField() order = db.IntField(unique_with='module_name') sub_modules = db.SortedListField(db.EmbeddedDocumentField(SubModule), ordering="sub_order", reverse=False) meta = {"collection": "module", "strict": "False", 'ordering': ['-order']}
class CourseModel(db.Document): _id = db.ObjectIdField() course_id = db.IntField() title = db.StringField() text = db.StringField() goal = db.StringField() frame_head = db.StringField() frame_foot = db.StringField() code = db.StringField() concept = db.SortedListField( db.ReferenceField(Concept, reverse_delete_rule=PULL)) meta = {"collection": "course", "strict": "False"}
class Unit(db.EmbeddedDocument): unit_id = db.ObjectIdField() unit_title = db.StringField() unit_order = db.IntField() unit_type = db.StringField()
class SubModule(db.EmbeddedDocument): sub_id = db.ObjectIdField() sub_order = db.IntField() type = db.StringField()