feat: discussions

This commit is contained in:
pateljannat
2021-08-16 13:33:08 +05:30
parent 6c9d49bf8c
commit a3672e9d91
29 changed files with 451 additions and 420 deletions

View File

@@ -0,0 +1,17 @@
import frappe
def get_context(context):
context.threads = get_threads()
def get_threads():
threads = frappe.get_all("Discussion Thread", fields=["name", "title"])
for thread in threads:
messages = frappe.get_all("Discussion Message",
{
"thread": thread.name
},
["owner"],
as_list=True)
thread.message_count = len(messages)
thread.member_count = len(set(messages))
return threads