Commit d250bebc authored by Brescia Amandy's avatar Brescia Amandy

Edited files to follow PEP8 guidelines

parent 4e4dd0a5
......@@ -12,5 +12,3 @@ class CourseAdmin(admin.ModelAdmin):
admin.site.register(Assignment, AssignmentAdmin)
admin.site.register(Course, CourseAdmin)
# Generated by Django 3.2 on 2023-03-06 04:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='assignment',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='assignment',
name='perfect_score',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='course',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='course',
name='section',
field=models.CharField(max_length=3),
),
]
......@@ -14,13 +14,12 @@ class Assignment(models.Model):
description = models.TextField(blank=True)
course = models.ForeignKey(Course, on_delete=models.CASCADE)
perfect_score = models.IntegerField(default=0)
@property
def passing_score(self):
passing_score = self.perfect_score * 0.60
return passing_score
def __str__(self):
def __str__(self):
return self.name
\ No newline at end of file
......@@ -10,7 +10,7 @@ def assignments(request):
return_string += 'Description: {}<br>'.format(assignment.description)
return_string += 'Perfect Score: {}<br>'.format(assignment.perfect_score)
return_string += 'Passing Score: {}<br>'.format(assignment.passing_score)
return_string += 'Course/Section: {} {}-{}<br><br>'.format(course.code, course.title, course.section)
return HttpResponse(return_string)
return_string += 'Course/Section: {} {}-{}<br><br>'.format(
course.code, course.title, course.section)
return HttpResponse(return_string)
No preview for this file type
......@@ -14,6 +14,7 @@ import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
......
......@@ -11,6 +11,7 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'widget_huli.settings')
application = get_wsgi_application()
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