Commit d7c88b7b authored by Jonathan Talbot's avatar Jonathan Talbot

video link

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