fix: added index to lesson doctype to fix the display order

This commit is contained in:
Anand Chitipothu
2021-05-08 13:40:46 +05:30
parent a3e53efcc1
commit 49d5ca4292
2 changed files with 11 additions and 3 deletions

View File

@@ -10,5 +10,6 @@ class Chapter(Document):
def get_lessons(self):
rows = frappe.db.get_all("Lesson",
filters={"chapter": self.name},
fields='*')
fields='*',
order_by="index_")
return [frappe.get_doc(dict(row, doctype='Lesson')) for row in rows]

View File

@@ -8,7 +8,8 @@
"field_order": [
"chapter",
"lesson_type",
"title"
"title",
"index_"
],
"fields": [
{
@@ -31,11 +32,17 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title"
},
{
"default": "1",
"fieldname": "index_",
"fieldtype": "Int",
"label": "Index"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-05-03 06:51:43.588969",
"modified": "2021-05-08 13:25:13.965162",
"modified_by": "Administrator",
"module": "LMS",
"name": "Lesson",