Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_quintupoltrobol
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
Matthew Karl David P. Arpas
final_quintupoltrobol
Commits
8a8d3f8f
Commit
8a8d3f8f
authored
May 14, 2023
by
Michael Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added forms.py for announcement-add.html
parent
615b8618
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
3 deletions
+11
-3
urls.cpython-39.pyc
...tupoltrobol/announcements/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
...upoltrobol/announcements/__pycache__/views.cpython-39.pyc
+0
-0
forms.py
widget_quintupoltrobol/announcements/forms.py
+7
-0
announcement-add.html
...nouncements/templates/announcements/announcement-add.html
+0
-0
urls.py
widget_quintupoltrobol/announcements/urls.py
+1
-0
views.py
widget_quintupoltrobol/announcements/views.py
+3
-3
No files found.
widget_quintupoltrobol/announcements/__pycache__/urls.cpython-39.pyc
View file @
8a8d3f8f
No preview for this file type
widget_quintupoltrobol/announcements/__pycache__/views.cpython-39.pyc
View file @
8a8d3f8f
No preview for this file type
widget_quintupoltrobol/announcements/forms.py
0 → 100644
View file @
8a8d3f8f
from
django
import
forms
from
.models
import
Announcement
class
AddAnnouncement
(
forms
.
ModelForm
):
class
Meta
:
model
=
Announcement
fields
=
"__all__"
\ No newline at end of file
widget_quintupoltrobol/announcements/templates/announcements/announcement-add.html
0 → 100644
View file @
8a8d3f8f
widget_quintupoltrobol/announcements/urls.py
View file @
8a8d3f8f
...
@@ -5,6 +5,7 @@ from .views import pageview
...
@@ -5,6 +5,7 @@ from .views import pageview
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
pageview
,
name
=
'pageview'
),
path
(
''
,
pageview
,
name
=
'pageview'
),
path
(
'<int:pk>/details/'
,
AnnouncementDetailView
.
as_view
(),
name
=
"announcement_details"
),
path
(
'<int:pk>/details/'
,
AnnouncementDetailView
.
as_view
(),
name
=
"announcement_details"
),
path
(
"add/"
,
)
]
]
app_name
=
"announcements"
app_name
=
"announcements"
\ No newline at end of file
widget_quintupoltrobol/announcements/views.py
View file @
8a8d3f8f
...
@@ -7,7 +7,7 @@ from django.shortcuts import render
...
@@ -7,7 +7,7 @@ from django.shortcuts import render
def
pageview
(
request
):
def
pageview
(
request
):
model_object
=
Announcement
.
objects
.
order_by
(
"-pub_datetime"
)
model_object
=
Announcement
.
objects
.
order_by
(
"-pub_datetime"
)
return
render
(
request
,
"announcement.html"
,
context
=
{
"announcement_list"
:
model_object
})
return
render
(
request
,
"announcement
s/announcements
.html"
,
context
=
{
"announcement_list"
:
model_object
})
def
UTC_to_PHTZ
(
utctime
):
def
UTC_to_PHTZ
(
utctime
):
...
@@ -18,11 +18,11 @@ def UTC_to_PHTZ(utctime):
...
@@ -18,11 +18,11 @@ def UTC_to_PHTZ(utctime):
class
AnnouncementListView
(
ListView
):
class
AnnouncementListView
(
ListView
):
model
=
Announcement
model
=
Announcement
template_name
=
"announcements.html"
template_name
=
"announcements
/announcements
.html"
class
AnnouncementDetailView
(
DetailView
):
class
AnnouncementDetailView
(
DetailView
):
model
=
Announcement
model
=
Announcement
template_name
=
"announcement-detail.html"
template_name
=
"announcement
s/announcement
-detail.html"
def
get_announcement_detail
(
self
,
**
kwargs
):
def
get_announcement_detail
(
self
,
**
kwargs
):
announcement
=
self
.
get_object
()
announcement
=
self
.
get_object
()
...
...
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