feat: added cohort and subgroup pages

Issue #271
This commit is contained in:
Anand Chitipothu
2021-11-30 07:46:48 +05:30
parent 102fa9c0a8
commit 1277cfed64
9 changed files with 327 additions and 7 deletions

View File

@@ -10,6 +10,14 @@ def get_doc(doctype, name):
except frappe.exceptions.DoesNotExistError:
return
def get_cohort(course, cohort_slug):
name = frappe.get_value("Cohort", {"course": course.name, "slug": cohort_slug})
return name and frappe.get_doc("Cohort", name)
def get_subgroup(cohort, subgroup_slug):
name = frappe.get_value("Cohort Subgroup", {"cohort": cohort.name, "slug": subgroup_slug})
return name and frappe.get_doc("Cohort Subgroup", name)
def add_nav(context, title, href):
"""Adds a breadcrumb to the navigation.
"""