Commit 4504933b authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

contents won't show up in assignments.html

parent aecfefec
......@@ -7,7 +7,7 @@
{% block content %}
<div class="content">
<ul style="list-style-type:square;">
{% for assignment in {{ assignmentsList }}.object.all() %}
{% for assignment in {{ assignmentsList }} %}
<li> <div class="assignmentLink"> <a href="{{ assignment.get_absolute_url }}/details"> {{ assignment.assignment_name }} </a> </div> </li>
{% endfor %}
</ul>
......
......@@ -5,7 +5,32 @@ from .models import Assignment
def homeAssignmentsPage(request):
return render(request, 'templates/assignments.html', {'assignmentsList': Assignment})
'''
context = {}
j = 0
for assignment in Assignment.objects.all():
context[str(j)]=assignment
j+=1
'''
starter = "{% block content %}\
<div class='content'>\
<ul style='list-style-type:square;'>\n"
middle = ""
for assignment in Assignment.objects.all():
middle+="<li> <div class='assignmentLink'> <a href='"
+ assignment.get_absolute_url()
+"'/details"
+ ">"
+ assignment.assignment_name
+" </a> </div> </li>"
ender = "</ul>\
</div>\
{% endblock %}"
output = starter+middle+ender
return render(request, 'templates/assignments.html', {"assignmentList":Assignment})
def index(request):
......@@ -35,3 +60,6 @@ def index(request):
</body></html>".format(head, body)
return HttpResponse(return_string)
def som():
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment