Commit 840d44c5 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

Merge branch 'assignmentsv2' into 'main'

Assignmentsv2

See merge request !19
parents 21b7128b cf2f23e6
......@@ -9,17 +9,17 @@ class AssignmentInline(admin.StackedInline):
class AssignmentAdmin(admin.ModelAdmin):
model = Assignment
list_display = ('assignment_name', 'section')
list_display = ('assignment_name', 'course',)
search_fields = ('course',)
list_filter = ('section', 'perfect_score', 'passing_score')
list_filter = ('course', 'perfect_score', 'passing_score')
class CourseAdmin(admin.ModelAdmin):
model = Course
list_display = ('course_code', 'course_title',)
search_fields = ('course_code', 'course_title',)
list_filter = ('course_code', 'course_title',)
list_display = ('course_code', 'course_title','section',)
search_fields = ('course_code', 'course_title','section',)
list_filter = ('course_code', 'course_title','section',)
admin.site.register(Course, CourseAdmin)
......
# Generated by Django 3.2 on 2023-05-12 05:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0003_auto_20230429_1712'),
]
operations = [
migrations.AlterField(
model_name='assignment',
name='assignment_name',
field=models.CharField(default='', max_length=50, unique=True, verbose_name='Name'),
),
]
# Generated by Django 3.2 on 2023-05-12 05:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0004_alter_assignment_assignment_name'),
]
operations = [
migrations.AddField(
model_name='assignment',
name='courseDropDown',
field=models.CharField(default='', max_length=100),
),
]
# Generated by Django 3.2 on 2023-05-12 05:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0005_assignment_coursedropdown'),
]
operations = [
migrations.AlterField(
model_name='assignment',
name='courseDropDown',
field=models.CharField(blank=True, default='', max_length=100, unique=True),
),
]
# Generated by Django 3.2 on 2023-05-12 06:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0006_alter_assignment_coursedropdown'),
]
operations = [
migrations.RemoveField(
model_name='assignment',
name='section',
),
migrations.AddField(
model_name='course',
name='section',
field=models.CharField(default='', max_length=16),
),
]
# Generated by Django 3.2 on 2023-05-12 06:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assignments', '0007_auto_20230512_1428'),
]
operations = [
migrations.RemoveField(
model_name='assignment',
name='courseDropDown',
),
]
......@@ -4,8 +4,12 @@ from django.db import models
class Course(models.Model):
course_code = models.CharField(unique=True, default="", max_length=10,)
course_title = models.CharField(unique=True, default="", max_length=50,)
section = models.CharField(default="",max_length=16,)
def __str__(self):
return '{} {}'.format(self.course_code, self.section,)
def anotherFormat(self):
return '{} {}'.format(self.course_code, self.course_title,)
......@@ -14,7 +18,6 @@ class Assignment(models.Model):
description = models.TextField(default="")
perfect_score = models.IntegerField(default=100)
passing_score = models.IntegerField(default=80)
section = models.CharField(max_length=16,)
course = models.ForeignKey(
Course,
on_delete=models.CASCADE,
......@@ -22,11 +25,13 @@ class Assignment(models.Model):
)
def __str__(self):
return '{} {}-'.format(self.assignment_name, self.section,)
return '{} {}-'.format(self.assignment_name, self.course.section,)
def get_absolute_url(self):
return '{}'.format(self.pk)
def save(self, *args, **kwargs):
self.passing_score = self.perfect_score*0.6
super(Assignment, self).save(*args, **kwargs)
......@@ -8,7 +8,7 @@
{% block heading %} <h1 class="pageTitle"> {{object.assignment_name}} </h1> {% endblock %}
{% block content %}
<h2> {{object.course}} - {{object.section}} </h2>
<h2> {{object.course.anotherFormat}} - {{object.course.section}} </h2>
<p> <b>Description:</b> {{object.description}} <br>
<b>Perfect Score:</b> {{object.perfect_score}} <br>
<b>Passing Score:</b> {{object.passing_score}} <br>
......
# Generated by Django 3.2 on 2023-05-12 05:00
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('forum', '0002_reply_post'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 0, 44, 600788), editable=False),
),
migrations.AlterField(
model_name='reply',
name='post',
field=models.ForeignKey(default=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='forum.forumpost'),
),
]
# Generated by Django 3.2 on 2023-05-12 05:16
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0003_auto_20230512_1300'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 16, 35, 558089), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 05:26
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0004_alter_forumpost_pub_datetime'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 26, 27, 568329), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 05:33
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0005_alter_forumpost_pub_datetime'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 33, 51, 594255), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 06:28
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0006_alter_forumpost_pub_datetime'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 28, 15, 198274), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 06:43
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0007_alter_forumpost_pub_datetime'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 43, 53, 323691), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 06:46
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0008_alter_forumpost_pub_datetime'),
]
operations = [
migrations.AlterField(
model_name='forumpost',
name='pub_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 46, 44, 130987), editable=False),
),
]
# Generated by Django 3.2 on 2023-05-12 05:00
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0008_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 0, 44, 602793)),
),
]
# Generated by Django 3.2 on 2023-05-12 05:16
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0009_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 16, 35, 560192)),
),
]
# Generated by Django 3.2 on 2023-05-12 05:26
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0010_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 26, 27, 570448)),
),
]
# Generated by Django 3.2 on 2023-05-12 05:33
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0011_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 13, 33, 51, 596255)),
),
]
# Generated by Django 3.2 on 2023-05-12 06:28
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0012_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 28, 15, 200372)),
),
]
# Generated by Django 3.2 on 2023-05-12 06:43
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0013_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 43, 53, 325690)),
),
]
# Generated by Django 3.2 on 2023-05-12 06:46
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0014_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 5, 12, 14, 46, 44, 132978)),
),
]
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