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 .models import Assignments, Course
from .models import Assignment, Course
# Register your models here.
class AssignmentsAdmin(admin.ModelAdmin):
model = Assignments
class AssignmentAdmin(admin.ModelAdmin):
model = Assignment
class CourseAdmin(admin.ModelAdmin):
model = Course
admin.site.register(Assignments, AssignmentsAdmin)
admin.site.register(Assignment, AssignmentAdmin)
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):
def get_absolute_url(self):
return reverse('course_detail', args=[str(self.section)])
class Assignments(models.Model):
class Assignment(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=10000)
course = models.CharField(max_length=10000)
......
......@@ -5,4 +5,4 @@ urlpatterns = [
path('', index, name='index'),
]
# This might be needed, depending on your Django version
app_name = "Assignments"
app_name = "Assignment"
from django.http import HttpResponse
from .models import Assignments
from .models import Assignment
# Create your view here.
......@@ -7,7 +7,7 @@ from .models import Assignments
def index(request):
overall_assignments = "<html><title>Assignments</title><body>" \
"<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 += "Description: %s<br>" %assignment.description
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