Removed unnecessary imports and adhered to PEP 8 guidelines

parent f6567878
from django.contrib import admin from django.contrib import admin
from .models import Assignment, Course from .models import Assignment, Course
class AssignmentAdmin(admin.ModelAdmin): class AssignmentAdmin(admin.ModelAdmin):
model = Assignment model = Assignment
class CourseAdmin(admin.ModelAdmin): class CourseAdmin(admin.ModelAdmin):
model = Course model = Course
admin.site.register(Assignment, AssignmentAdmin) admin.site.register(Assignment, AssignmentAdmin)
admin.site.register(Course, CourseAdmin) admin.site.register(Course, CourseAdmin)
from django.db import models from django.db import models
class Course(models.Model): class Course(models.Model):
code = models.CharField(max_length=10, blank=True, null=True) code = models.CharField(max_length=10, blank=True, null=True)
title = models.CharField(max_length=255, blank=True, null=True) title = models.CharField(max_length=255, blank=True, null=True)
section = models.CharField(max_length=3, blank=True, null=True) section = models.CharField(max_length=3, blank=True, null=True)
class Assignment(models.Model): class Assignment(models.Model):
name = models.CharField(max_length=255, blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True)
description = models.TextField(blank=True, null=True) description = models.TextField(blank=True, null=True)
......
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