Neil Trini Lasrado | 3f0a581 | 2016-07-19 14:17:33 +0530 | [diff] [blame] | 1 | # License: GNU General Public License v3. See license.txt |
| 2 | |
| 3 | from __future__ import unicode_literals |
| 4 | import frappe |
| 5 | |
| 6 | |
| 7 | def get_context(context): |
| 8 | topic = frappe.get_doc('Topic', frappe.form_dict.topic) |
| 9 | context.no_cache = 1 |
| 10 | context.show_sidebar = True |
| 11 | context.doc = topic |
| 12 | attachments = frappe.db.sql("""select file_url, file_name from tabFile as file |
| 13 | where file.attached_to_name=%s """,(topic.name), as_dict = True) |
| 14 | |
| 15 | context.attached_files = attachments |