Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_bigdjangoenergy
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
Alec Dayupay
midterm_bigdjangoenergy
Commits
fc49b221
Commit
fc49b221
authored
Mar 02, 2023
by
Anthony Bicomong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed announcement app bug with WidgetUser
parent
856d4cb0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
4 deletions
+23
-4
models.cpython-311.pyc
...goenergy/announcements/__pycache__/models.cpython-311.pyc
+0
-0
views.cpython-311.pyc
...ngoenergy/announcements/__pycache__/views.cpython-311.pyc
+0
-0
0002_alter_announcement_author.py
...nnouncements/migrations/0002_alter_announcement_author.py
+20
-0
0002_alter_announcement_author.cpython-311.pyc
..._pycache__/0002_alter_announcement_author.cpython-311.pyc
+0
-0
models.py
widget_bigdjangoenergy/announcements/models.py
+1
-2
views.py
widget_bigdjangoenergy/announcements/views.py
+2
-2
No files found.
widget_bigdjangoenergy/announcements/__pycache__/models.cpython-311.pyc
View file @
fc49b221
No preview for this file type
widget_bigdjangoenergy/announcements/__pycache__/views.cpython-311.pyc
View file @
fc49b221
No preview for this file type
widget_bigdjangoenergy/announcements/migrations/0002_alter_announcement_author.py
0 → 100644
View file @
fc49b221
# Generated by Django 3.2 on 2023-03-02 08:53
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'dashboard'
,
'0001_initial'
),
(
'announcements'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'announcement'
,
name
=
'author'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'dashboard.widgetuser'
),
),
]
widget_bigdjangoenergy/announcements/migrations/__pycache__/0002_alter_announcement_author.cpython-311.pyc
0 → 100644
View file @
fc49b221
File added
widget_bigdjangoenergy/announcements/models.py
View file @
fc49b221
...
@@ -4,8 +4,7 @@ from django.urls import reverse
...
@@ -4,8 +4,7 @@ from django.urls import reverse
class
Announcement
(
models
.
Model
):
class
Announcement
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
50
)
title
=
models
.
CharField
(
max_length
=
50
)
body
=
models
.
CharField
(
max_length
=
700
)
body
=
models
.
CharField
(
max_length
=
700
)
#author = models.ForeignKey("dashboard.WidgetUser", on_delete=models.CASCADE)
author
=
models
.
ForeignKey
(
"dashboard.WidgetUser"
,
on_delete
=
models
.
CASCADE
)
author
=
models
.
CharField
(
max_length
=
200
)
pub_datetime
=
models
.
DateTimeField
()
pub_datetime
=
models
.
DateTimeField
()
def
__str__
(
self
):
def
__str__
(
self
):
...
...
widget_bigdjangoenergy/announcements/views.py
View file @
fc49b221
...
@@ -8,8 +8,8 @@ def index(request):
...
@@ -8,8 +8,8 @@ def index(request):
response
=
"Big Django Energy - Announcement Board<br><br>Announcements:<br>"
response
=
"Big Django Energy - Announcement Board<br><br>Announcements:<br>"
for
announcement
in
all_announcements
:
for
announcement
in
all_announcements
:
announcementpubdate
=
announcement
.
pub_datetime
.
strftime
(
"
%
m/
%
d/
%
Y,
%
H:
%
M:
%
S"
)
+
", "
#TO_DO: fix timezone
announcementpubdate
=
announcement
.
pub_datetime
.
strftime
(
"
%
m/
%
d/
%
Y,
%
H:
%
M:
%
S"
)
+
", "
response
=
response
+
announcement
.
title
+
" by "
+
announcement
.
author
.
first_name
+
" "
+
announcement
.
author
.
last_name
#TO_DO: widgetUser functionality (parsing author info
)
response
=
response
+
announcement
.
title
+
" by "
+
announcement
.
author
.
__str__
(
)
response
=
response
+
" published "
+
announcementpubdate
+
"<br>"
response
=
response
+
" published "
+
announcementpubdate
+
"<br>"
response
=
response
+
announcement
.
body
+
"<br>"
response
=
response
+
announcement
.
body
+
"<br>"
for
reaction
in
all_reactions
:
for
reaction
in
all_reactions
:
...
...
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