@@ -0,0 +1,1457 @@
+%22%22%22Views for dasem app.%22%22%22%0A%0A%0Afrom re import findall, UNICODE%0A%0Afrom flask import render_template, request%0A%0Afrom . import app%0A%0A%0ADANNET_SYNSET_QUERY = u%22%22%22%0Aselect w.form, ws.word_id, w.pos, s.gloss %0Afrom words w, wordsenses ws, synsets s%0Awhere w.form = '%7Bword%7D'%0A  and ws.word_id = w.id%0A  and s.id = ws.synset_id%0A%22%22%22%0A%0ADANNET_RELATIONS_QUERY = u%22%22%22%0Aselect s.label %0Afrom (%0A  select r.value%0A  from words w, wordsenses ws, relations r%0A  where w.form = '%7Bword%7D'%0A    and w.id = ws.word_id%0A    and r.synset_id = ws.synset_id)%0A  as a, synsets s%0Awhere s.id = a.value;%0A%22%22%22%0A%0A%0A@app.route(%22/%22)%0Adef index():%0A    %22%22%22Return index page of for app.%22%22%22%0A    q = request.args.get('q', '')%0A    first_word = q.strip().split(' ')%5B0%5D.lower()%0A    dannet_synsets_table, dannet_relations_table = '(empty)', '(empty)'%0A    if q:%0A        first_word = findall('%5Cw+', first_word, flags=UNICODE)%5B0%5D%0A%0A        # https://github.com/yhat/db.py/issues/90%0A        # df = app._dasem_dannet.db.query(%0A        #     query, data=%7B'word': first_word%7D)%0A        %0A        query = DANNET_SYNSET_QUERY.format(word=first_word)%0A        dannet_synsets_table = app._dasem_dannet.db.query(query).to_html()%0A%0A        query = DANNET_RELATIONS_QUERY.format(word=first_word)%0A        dannet_relations_table = app._dasem_dannet.db.query(query).to_html()%0A        %0A    return render_template(%0A        'index.html', q=q,%0A        dannet_synset_table=dannet_synsets_table,%0A        dannet_relations_table=dannet_relations_table)%0A

Create views.py