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
b1fd71ae
Commit
b1fd71ae
authored
Mar 23, 2022
by
Jonathan Talbot
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'flores/forum' into 'main'
Added Forum to models.py See merge request
!4
parents
ab46f8c2
7d1800ca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
admin.py
widget_group3/widget_group3/admin.py
+14
-3
models.py
widget_group3/widget_group3/models.py
+12
-0
settings.py
widget_group3/widget_group3/settings.py
+1
-1
No files found.
widget_group3/widget_group3/admin.py
View file @
b1fd71ae
from
django.contrib
import
admin
from
.models
import
WidgetUser
from
.models
import
WidgetUser
,
Forum
# Classes
...
...
@@ -21,9 +20,21 @@ class WidgetUserAdmin(admin.ModelAdmin):
}),
]
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
)])
# Register models
admin
.
site
.
register
(
WidgetUser
,
WidgetUserAdmin
)
admin
.
site
.
register
(
Forum
,
ForumAdmin
)
widget_group3/widget_group3/models.py
View file @
b1fd71ae
from
django.db
import
models
from
django.urls
import
reverse
class
Forum
(
models
.
Model
):
post_title
=
models
.
CharField
(
max_length
=
50
)
post_body
=
models
.
CharField
(
max_length
=
100
)
pub_date
=
models
.
DateTimeField
(
auto_now_add
=
True
,
editable
=
False
)
def
__str__
(
self
):
return
self
.
post_title
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
)
...
...
widget_group3/widget_group3/settings.py
View file @
b1fd71ae
...
...
@@ -40,7 +40,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'widget_group3'
'widget_group3'
,
]
MIDDLEWARE
=
[
...
...
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