blob: 8a55b640e778cdce22dbfcff04e41882ad102ec1 [file] [log] [blame]
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +05301# License: GNU General Public License v3. See license.txt
2
3from __future__ import unicode_literals
4import frappe
5
6
7def 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