from .tool.func import * async def topic_list(name = 'Test'): with get_db_connect() as conn: curs = conn.cursor() div = '' tool = flask.request.args.get('tool', '') plus = '' menu = [['topic/' + url_pas(name), await get_lang('return')]] if tool == 'close': curs.execute(db_change("select code, sub from rd where title = ? and stop = 'O' order by sub asc"), [name]) sub = await get_lang('closed_discussion') elif tool == 'agree': curs.execute(db_change("select code, sub from rd where title = ? and agree = 'O' order by sub asc"), [name]) sub = await get_lang('agreed_discussion') else: sub = await get_lang('discussion_list') menu = [['w/' + url_pas(name), await get_lang('document')]] plus = ''' (' + await get_lang('closed_discussion') + ''') (' + await get_lang('agreed_discussion') + ''')