Commit dfad8189 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

another solution for views and it still won't work

parent 4504933b
......@@ -58,8 +58,8 @@ cover/
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
#db.sqlite3
#db.sqlite3-journal
# Flask stuff:
instance/
......
......@@ -4,15 +4,7 @@
{% block pageTitle %} <h1> Assignments </h1> {% endblock %}
{% block content %}
<div class="content">
<ul style="list-style-type:square;">
{% for assignment in {{ assignmentsList }} %}
<li> <div class="assignmentLink"> <a href="{{ assignment.get_absolute_url }}/details"> {{ assignment.assignment_name }} </a> </div> </li>
{% endfor %}
</ul>
</div>
{% endblock %}
{{ addition }}
{% block otherButtons %}
<div class="content">
......
......@@ -5,32 +5,20 @@ from .models import Assignment
def homeAssignmentsPage(request):
'''
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>"
middle = middle + "<li> <div class='assignmentLink'> \
<a href='"+ str(assignment.get_absolute_url)+"'/details>" + str(assignment.assignment_name)+" </a> </div> </li>"
ender = "</ul>\
</div>\
{% endblock %}"
output = starter+middle+ender
return render(request, 'templates/assignments.html', {"assignmentList":Assignment})
return render(request, 'templates/assignments.html', {"addition":output})
def index(request):
......
# Generated by Django 3.2 on 2023-04-29 07:07
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0006_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 4, 29, 15, 7, 16, 727183)),
),
]
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