Added the assignments model and admin

Title says
parent 855f761b
No preview for this file type
from django.contrib import admin
from .models import Assignment
#from .models import WidgetUser, Announcement, Post, Assignment
\ No newline at end of file
class AssignmentAdmin(admin.ModelAdmin):
model = Assignment
search_fields = ('name', 'description', 'max_points')
list_display = ('name', 'description', 'max_points')
list_filter = ('name', 'description', 'max_points')
fieldsets = [
('Assignment Data', {
'fields': [
'name',
'description',
'max_points'
]
}
)
]
admin.site.register(Assignment, AssignmentAdmin)
\ No newline at end of file
from django.db import models
from django.urls import reverse
class Assignments(models.Model):
name = models.CharField(max_length = 25)
description = models.Charfield(max_length = 200)
max_points = models.IntegerField()
\ No newline at end of file
class Assignment(models.Model):
name = models.CharField(max_length = 100)
description = models.CharField(max_length = 200)
max_points = models.IntegerField()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('assignment', args[(self.name)])
\ No newline at end of file
......@@ -40,6 +40,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'widget_group3'
]
MIDDLEWARE = [
......
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