Commit 23487061 authored by jmAmador's avatar jmAmador

renamed the assignments app to assignment

it showed "Assignmentss" instead of "Assignment" in the admin page.
parent 1c9f11b1
from django.contrib import admin from django.contrib import admin
from .models import Assignments, Course from .models import Assignment, Course
# Register your models here. # Register your models here.
class AssignmentsAdmin(admin.ModelAdmin): class AssignmentAdmin(admin.ModelAdmin):
model = Assignments model = Assignment
class CourseAdmin(admin.ModelAdmin): class CourseAdmin(admin.ModelAdmin):
model = Course model = Course
admin.site.register(Assignments, AssignmentsAdmin) admin.site.register(Assignment, AssignmentAdmin)
admin.site.register(Course, CourseAdmin) admin.site.register(Course, CourseAdmin)
# Generated by Django 4.1.7 on 2023-03-02 21:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Assignments', '0004_assignments_course_stuff'),
]
operations = [
migrations.RenameModel(
old_name='Assignments',
new_name='Assignment',
),
]
...@@ -14,7 +14,7 @@ class Course(models.Model): ...@@ -14,7 +14,7 @@ class Course(models.Model):
def get_absolute_url(self): def get_absolute_url(self):
return reverse('course_detail', args=[str(self.section)]) return reverse('course_detail', args=[str(self.section)])
class Assignments(models.Model): class Assignment(models.Model):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
description = models.CharField(max_length=10000) description = models.CharField(max_length=10000)
course = models.CharField(max_length=10000) course = models.CharField(max_length=10000)
......
...@@ -5,4 +5,4 @@ urlpatterns = [ ...@@ -5,4 +5,4 @@ urlpatterns = [
path('', index, name='index'), path('', index, name='index'),
] ]
# This might be needed, depending on your Django version # This might be needed, depending on your Django version
app_name = "Assignments" app_name = "Assignment"
from django.http import HttpResponse from django.http import HttpResponse
from .models import Assignments from .models import Assignment
# Create your view here. # Create your view here.
...@@ -7,7 +7,7 @@ from .models import Assignments ...@@ -7,7 +7,7 @@ from .models import Assignments
def index(request): def index(request):
overall_assignments = "<html><title>Assignments</title><body>" \ overall_assignments = "<html><title>Assignments</title><body>" \
"<h1> Widget's Assignments Page!</h1>" "<h1> Widget's Assignments Page!</h1>"
for assignment in Assignments.objects.all(): for assignment in Assignment.objects.all():
overall_assignments += "<p><b>Assignment Name: %s</b><br>" %assignment.name overall_assignments += "<p><b>Assignment Name: %s</b><br>" %assignment.name
overall_assignments += "Description: %s<br>" %assignment.description overall_assignments += "Description: %s<br>" %assignment.description
overall_assignments += "Perfect Score: %i<br>" %assignment.perfect_score overall_assignments += "Perfect Score: %i<br>" %assignment.perfect_score
......
No preview for this file type
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