forked from openscriptures/api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathviews.py
More file actions
36 lines (27 loc) · 1.04 KB
/
views.py
File metadata and controls
36 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from django.http import HttpResponse
from django.shortcuts import render_to_response
from models import *
import sys, os
def index(request):
#return render_to_response('polls/detail.html', {'poll': p})
html = "<html><head><style>span:hover {background:yellow; outline:solid 1px red;}</style></head><body>"
html += "<h1>Works</h1>"
for work in Work.objects.all():
html += work.title + "<br />"
#html += "<h1>Structures</h1>"
#for ts in TokenStructure.objects.all():
# html += ts.osis_id + "<br />"
html += "<h1>Tokens</h1>"
for token in Token.objects.all():
if token.type == Token.WHITESPACE:
if token.data == "\n\n":
html += "<br><br>"
else:
html += token.data
else:
html += "<span id='t" + str(token.pk) + "'>"
html += token.data
html += "</span>"
html += "</body></html>"
#html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)