Commit ae8a6f4d authored by Jeremy Factor's avatar Jeremy Factor

created a model for assignment

parent 58b77f56
from django.contrib import admin from django.contrib import admin
# Register your models here. # Register your models here.
from .models import Assignment
class AssignmentAdmin(admin.ModelAdmin):
model = Assignment
search_fields = ('name',)
list_display = ('name', 'description',)
admin.site.register(Assignment, AssignmentAdmin)
\ No newline at end of file
# Generated by Django 3.2.12 on 2022-03-23 14:03
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=50)),
('description', models.CharField(max_length=500)),
('max_points', models.IntegerField(default=0)),
],
),
]
from django.db import models from django.db import models
# Create your models here. # Create your models here.
class Assignment(models.Model):
name = models.CharField(max_length = 50)
description = models.CharField(max_length = 500)
max_points = models.IntegerField(default = 0)
def __str__(self):
return self.name
\ No newline at end of file
No preview for this file type
...@@ -37,6 +37,7 @@ ALLOWED_HOSTS = [] ...@@ -37,6 +37,7 @@ ALLOWED_HOSTS = []
INSTALLED_APPS = [ INSTALLED_APPS = [
'announcements.apps.AnnouncementsConfig', 'announcements.apps.AnnouncementsConfig',
'assignments.apps.AssignmentsConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
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