Commit cbf222b7 authored by Sumawang, Tee Jay Jr. C.'s avatar Sumawang, Tee Jay Jr. C.

pycache!!

parents 351e21e6 9599c99a
widget_tee_jays_angelos/homepage/__pycache__/
widget_tee_jays_angelos/homepage/migrations/__pycache__/
widget_tee_jays_angelos/announcements/__pycache__/
widget_tee_jays_angelos/announcements/migrations/__pycache__/
widget_tee_jays_angelos/forum/__pycache__/
widget_tee_jays_angelos/forum/migrations/__pycache__/
widget_tee_jays_angelos/assignments/__pycache__/
widget_tee_jays_angelos/assignments/migrations/__pycache__/
*/__pycache__/*
\ No newline at end of file
h1 {
color: blue;
font-weight: bold;
}
ul li {
text-decoration: underline;
}
li {
padding-bottom: 20px;
}
.bold{
font-weight: bold;
color: red;
font-size: 20px;
}
.small{
font-weight: normal
color: black;
font-size: 17px;
}
{% extends 'base.html' %}
{% block head %}
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'assignments/style.css' %}">
{% endblock %}
{% block content %}
<h1> {{course}} {{course.course_title}}</h1>
<li class = "bold"> Name: {{assignment.name}} </li>
<li> Description: {{assignment.description}} </li>
<li> Perfect Score: {{assignment.max_points}} </li>
<li> Passing Score: {{assignment.passing_score}} </li>
<img src= "/static/assignments/{{assignment.name}}.jpg">
{% endblock %}
{% extends 'base.html' %}
{% block head %}
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'assignments/style.css' %}">
{% endblock %}
{% block content %}
<h1> Assignments Per Course </h1>
{% if course_list %}
{% for course in course_list %}
<li class = "bold"> {{course}} {{course.course_title}} {{course.section}}
{% for assignment in assignment_list %}
{% if assignment.course_code == course %}
<ul class = "small">
<li> <a href="/assignments/{{assignment.name}}/">{{assignment.name}}</a></li>
</ul>
{% endif %}
{% endfor %}
</li>
{% endfor %}
{% else %}
<p>No assignments are available </p>
{% endif %}
{% endblock %}
...@@ -3,5 +3,6 @@ from django.urls import path ...@@ -3,5 +3,6 @@ from django.urls import path
from . import views from . import views
urlpatterns = [ urlpatterns = [
path('', views.index, name="assignments") path('', views.index, name="assignments"),
path("<str:name>/", views.detail, name = "details"),
] ]
from django.http import HttpResponse from django.http import HttpResponse, Http404
from assignments.models import Assignment, Course from assignments.models import Assignment, Course
from django.shortcuts import render
from django.template import loader
# Create your views here. # Create your views here.
def index(request): def index(request):
assignmentOutput = "Assignments: <br/><br/>" course_list = Course.objects.order_by("course_code")
for n in Assignment.objects.all(): assignment_list = Assignment.objects.all()
assignmentOutput += ("Assignment Name: " + str(n.name) + "<br/>") template = loader.get_template("assignments/index.html")
assignmentOutput += ("Description: " + n.description + "<br/>") context = {
assignmentOutput += ("Perfect Score: " + str(n.max_points) + "<br/>") "course_list": course_list,
assignmentOutput += ("Passing Score: " + str(n.passing_score) + "<br/>") "assignment_list": assignment_list
assignmentOutput += ("Course/Section: " + Course.objects.get(course_code = n.course_code).course_code + " ") }
assignmentOutput += (Course.objects.get(course_code = n.course_code).course_title + " ") return HttpResponse(template.render(context, request))
assignmentOutput += (Course.objects.get(course_code = n.course_code).section + "<br/><br/>")
return HttpResponse(assignmentOutput) def detail(request, name):
try:
assignment = Assignment.objects.get(name = name)
course = Course.objects.get(course_code = assignment.course_code)
except Assignment.DoesNotExist:
raise Http404("Assignment does not exist!")
template = loader.get_template("assignments/detail.html")
context = {
"assignment": assignment,
"course": course
}
return HttpResponse (template.render(context, request))
# Generated by Django 4.0.3 on 2022-04-05 13:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0002_widgetuser_email_widgetuser_id_num_department'),
]
operations = [
migrations.AlterField(
model_name='department',
name='dept_name',
field=models.CharField(max_length=50, null=True),
),
migrations.AlterField(
model_name='department',
name='home_unit',
field=models.CharField(max_length=50, null=True),
),
migrations.AlterField(
model_name='widgetuser',
name='first_name',
field=models.CharField(max_length=50, null=True),
),
migrations.AlterField(
model_name='widgetuser',
name='last_name',
field=models.CharField(max_length=50, null=True),
),
migrations.AlterField(
model_name='widgetuser',
name='middle_name',
field=models.CharField(max_length=50, null=True),
),
]
# Generated by Django 4.0.3 on 2022-05-08 04:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('homepage', '0003_alter_department_dept_name_and_more'),
]
operations = [
migrations.RemoveField(
model_name='widgetuser',
name='email',
),
]
# Generated by Django 4.0.3 on 2022-05-08 05:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0004_remove_widgetuser_email'),
]
operations = [
migrations.AddField(
model_name='widgetuser',
name='email',
field=models.CharField(max_length=50, null=True),
),
]
# Generated by Django 4.0.3 on 2022-05-08 08:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0005_widgetuser_email'),
]
operations = [
migrations.AddField(
model_name='widgetuser',
name='picture',
field=models.ImageField(null=True, upload_to=None),
),
]
# Generated by Django 4.0.3 on 2022-05-08 08:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0006_widgetuser_picture'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='picture',
field=models.ImageField(null=True, upload_to='media'),
),
]
# Generated by Django 4.0.3 on 2022-05-10 06:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0007_alter_widgetuser_picture'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='media'),
),
]
# Generated by Django 4.0.3 on 2022-05-10 07:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0008_alter_widgetuser_picture'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='static/media/'),
),
]
# Generated by Django 4.0.3 on 2022-05-10 07:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0009_alter_widgetuser_picture'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='homepage/static/media/'),
),
]
# Generated by Django 4.0.3 on 2022-05-10 14:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0010_alter_widgetuser_picture'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='media/'),
),
]
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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