Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jonathan Talbot
widget_group3
Commits
d7c88b7b
Commit
d7c88b7b
authored
Mar 23, 2022
by
Jonathan Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video link
parent
c601f00d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
30 deletions
+77
-30
README.md
README.md
+6
-3
db.sqlite3
widget_group3/db.sqlite3
+0
-0
admin.cpython-310.pyc
...et_group3/widget_group3/__pycache__/admin.cpython-310.pyc
+0
-0
models.cpython-310.pyc
...t_group3/widget_group3/__pycache__/models.cpython-310.pyc
+0
-0
settings.cpython-310.pyc
...group3/widget_group3/__pycache__/settings.cpython-310.pyc
+0
-0
admin.py
widget_group3/widget_group3/admin.py
+55
-11
models.py
widget_group3/widget_group3/models.py
+16
-16
No files found.
README.md
View file @
d7c88b7b
# 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
widget_group3/db.sqlite3
View file @
d7c88b7b
No preview for this file type
widget_group3/widget_group3/__pycache__/admin.cpython-310.pyc
View file @
d7c88b7b
No preview for this file type
widget_group3/widget_group3/__pycache__/models.cpython-310.pyc
View file @
d7c88b7b
No preview for this file type
widget_group3/widget_group3/__pycache__/settings.cpython-310.pyc
View file @
d7c88b7b
No preview for this file type
widget_group3/widget_group3/admin.py
View file @
d7c88b7b
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
)
widget_group3/widget_group3/models.py
View file @
d7c88b7b
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
)])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment