Commit 2b804b8b authored by Raul Jarod Conanan's avatar Raul Jarod Conanan

Merge branch 'Assignments' into 'dev'

Assignments

See merge request !11
parents 21c92230 60d561f1
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)
......
from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from .models import Assignment, Course from .models import Assignment
import os
def index(request): def index(request):
......
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