feat: add and remove students and courses from class

This commit is contained in:
Jannat Patel
2022-11-14 16:20:13 +05:30
parent 7ac3f6d8ef
commit 3e1f29af48
17 changed files with 478 additions and 40 deletions

View File

@@ -0,0 +1,17 @@
import frappe
def get_context(context):
context.no_cache = 1
class_name = frappe.form_dict["classname"]
context.class_info = frappe.db.get_value("LMS Class", class_name, ["name", "title", "start_date", "end_date", "description"], as_dict=True)
context.published_courses = frappe.get_all("LMS Course", {"published": 1}, ["name", "title"])
context.class_courses = frappe.get_all("Class Course", {
"parent": class_name
}, pluck="course")
context.class_students = frappe.get_all("Class Student", {
"parent": class_name
}, ["student", "student_name"])