Added Assignment data model

parent 60374faf
from django.contrib import admin from django.contrib import admin
# Register your models here. from .models import Assignment
admin.site.register(Assignment)
# Generated by Django 4.0.3 on 2022-03-15 12:17
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Assignment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=120)),
('description', models.TextField(blank=True)),
('max_points', models.IntegerField(default=1)),
],
),
]
from django.db import models from django.db import models
# Create your models here.
class Assignment(models.Model):
name = models.CharField(max_length=120)
description = models.TextField(blank=True)
max_points = models.IntegerField(default=1)
...@@ -6,4 +6,3 @@ urlpatterns = [ ...@@ -6,4 +6,3 @@ urlpatterns = [
] ]
app_name = "assignments" app_name = "assignments"
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
# View for assignment page
def index(request): def index(request):
return HttpResponse("This is the Assignments page!") return HttpResponse("This is the Assignments page!")
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