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/ ...@@ -58,8 +58,8 @@ cover/
# Django stuff: # Django stuff:
*.log *.log
local_settings.py local_settings.py
db.sqlite3 #db.sqlite3
db.sqlite3-journal #db.sqlite3-journal
# Flask stuff: # Flask stuff:
instance/ instance/
......
...@@ -4,15 +4,7 @@ ...@@ -4,15 +4,7 @@
{% block pageTitle %} <h1> Assignments </h1> {% endblock %} {% block pageTitle %} <h1> Assignments </h1> {% endblock %}
{% block content %} {{ addition }}
<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 %}
{% block otherButtons %} {% block otherButtons %}
<div class="content"> <div class="content">
......
...@@ -5,32 +5,20 @@ from .models import Assignment ...@@ -5,32 +5,20 @@ from .models import Assignment
def homeAssignmentsPage(request): def homeAssignmentsPage(request):
'''
context = {}
j = 0
for assignment in Assignment.objects.all():
context[str(j)]=assignment
j+=1
'''
starter = "{% block content %}\ starter = "{% block content %}\
<div class='content'>\ <div class='content'>\
<ul style='list-style-type:square;'>\n" <ul style='list-style-type:square;'>\n"
middle = "" middle = ""
for assignment in Assignment.objects.all(): for assignment in Assignment.objects.all():
middle+="<li> <div class='assignmentLink'> <a href='" middle = middle + "<li> <div class='assignmentLink'> \
+ assignment.get_absolute_url() <a href='"+ str(assignment.get_absolute_url)+"'/details>" + str(assignment.assignment_name)+" </a> </div> </li>"
+"'/details"
+ ">"
+ assignment.assignment_name
+" </a> </div> </li>"
ender = "</ul>\ ender = "</ul>\
</div>\ </div>\
{% endblock %}" {% endblock %}"
output = starter+middle+ender output = starter+middle+ender
return render(request, 'templates/assignments.html', {"assignmentList":Assignment}) return render(request, 'templates/assignments.html', {"addition":output})
def index(request): 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