brotherton-erpnext/erpnext/templates/pages/topics.py

16 lines
462 B
Python
Raw Normal View History

2016-07-19 08:47:33 +00:00
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def get_context(context):
topic = frappe.get_doc('Topic', frappe.form_dict.topic)
context.no_cache = 1
context.show_sidebar = True
context.doc = topic
attachments = frappe.db.sql("""select file_url, file_name from tabFile as file
where file.attached_to_name=%s """,(topic.name), as_dict = True)
context.attached_files = attachments