Commit d7c88b7b authored by Jonathan Talbot's avatar Jonathan Talbot

video link

parent c601f00d
# Group 3 - Lab 1: Widget
# Group 3
### Jonathan Talbot - Homepage
......@@ -9,5 +9,8 @@
### Giancarlo De Torres - Assignments
## Video link:
## Lab 1: Video link:
### https://drive.google.com/file/d/1iEkbHXomN2VUXBepXeVk2zCTFWFxRD0A/view?usp=sharing
## Lab 2: Video link:
### https://drive.google.com/file/d/1JqTDjraUkpCbQ_alrvoAGlDRjvGIuyL4/view?usp=sharing
\ No newline at end of file
No preview for this file type
from django.contrib import admin
from .models import WidgetUser, Forum, Announcement
from .models import WidgetUser, Forum, Announcement, Assignment
# Classes
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
search_fields = ('first_name', 'middle_name', 'last_name')
list_display = ('first_name', 'middle_name', 'last_name')
list_filter = ('first_name', 'middle_name', 'last_name')
fieldsets = [
('Widget User Data', {
'fields': [
'first_name',
'middle_name',
'last_name'
]
}),
]
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
......@@ -20,25 +38,50 @@ class AnnouncementAdmin(admin.ModelAdmin):
})
]
class ForumAdmin(admin.ModelAdmin):
model = Forum
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
search_fields = ('first_name', 'middle_name', 'last_name')
list_display = ('first_name', 'middle_name', 'last_name')
list_filter = ('first_name', 'middle_name', 'last_name')
search_fields = ('post_title', 'post_body', 'pub_date')
list_display = ('post_title', 'post_body', 'pub_date')
list_filter = ('post_title', 'post_body', 'pub_date')
fieldsets = [
('Widget User Data', {
('Forum Data', {
'fields': [
'first_name',
'middle_name',
'last_name'
'post_title',
'post_body',
]
}),
]
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'
]
}
)
]
......@@ -46,3 +89,4 @@ class WidgetUserAdmin(admin.ModelAdmin):
admin.site.register(WidgetUser, WidgetUserAdmin)
admin.site.register(Forum, ForumAdmin)
admin.site.register(Announcement, AnnouncementAdmin)
admin.site.register(Assignment, AssignmentAdmin)
from django.db import models
from django.urls import reverse
class WidgetUser(models.Model):
first_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
def __str__(self):
return self.full_name
def get_absolute_url(self):
return reverse('widget_user', args=[(self.full_name)])
@property
def full_name(self):
return '{} {} {}'.format(self.first_name, self.middle_name, self.last_name)
class Announcement(models.Model):
announcement_title= models.CharField(max_length=50)
announcement_body = models.CharField(max_length=200)
......@@ -28,21 +43,6 @@ class Forum(models.Model):
def get_absolute_url(self):
return reverse('forum', args=[(self.post_title)])
class WidgetUser(models.Model):
first_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
def __str__(self):
return self.full_name
def get_absolute_url(self):
return reverse('widget_user', args=[(self.full_name)])
@property
def full_name(self):
return '{} {} {}'.format(self.first_name, self.middle_name, self.last_name)
class Assignment(models.Model):
name = models.CharField(max_length = 100)
description = models.CharField(max_length = 200)
......@@ -52,4 +52,4 @@ class Assignment(models.Model):
return self.name
def get_absolute_url(self):
return reverse('assignment', args[(self.name)])
return reverse('assignment', args=[(self.name)])
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