Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_django unchained
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
1
Merge Requests
1
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
Jose Emmanuel B. Laurel
widget_django unchained
Commits
eb72774a
Commit
eb72774a
authored
May 26, 2022
by
Joshua Son
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: index view is now CBV, hopefully
parent
411e7579
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
3 deletions
+13
-3
urls.cpython-39.pyc
...o_unchained/announcements/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
..._unchained/announcements/__pycache__/views.cpython-39.pyc
+0
-0
create_announcement.html
...uncements/templates/announcement/create_announcement.html
+1
-1
urls.py
widget_django_unchained/announcements/urls.py
+3
-2
views.py
widget_django_unchained/announcements/views.py
+9
-0
db.sqlite3
widget_django_unchained/db.sqlite3
+0
-0
No files found.
widget_django_unchained/announcements/__pycache__/urls.cpython-39.pyc
View file @
eb72774a
No preview for this file type
widget_django_unchained/announcements/__pycache__/views.cpython-39.pyc
View file @
eb72774a
No preview for this file type
widget_django_unchained/announcements/templates/announcement/create_announcement.html
View file @
eb72774a
...
@@ -22,6 +22,6 @@
...
@@ -22,6 +22,6 @@
</form>
</form>
<br>
<br>
<br>
<br>
<a
href=
"{% url '
index
' %}"
>
Go back
</a>
<a
href=
"{% url '
showAnnouncements
' %}"
>
Go back
</a>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_django_unchained/announcements/urls.py
View file @
eb72774a
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.
import
views
from
django.conf
import
settings
from
.views
import
showAnnouncements
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index
'
),
path
(
''
,
showAnnouncements
.
as_view
(),
name
=
'showAnnouncements
'
),
path
(
"<int:announcement_id>/"
,
views
.
detail
,
name
=
"detail"
),
path
(
"<int:announcement_id>/"
,
views
.
detail
,
name
=
"detail"
),
path
(
"add/"
,
views
.
add
,
name
=
"add"
),
path
(
"add/"
,
views
.
add
,
name
=
"add"
),
#path("add/newAnnounce", views.newAnnounce, name="newAnnounce")
#path("add/newAnnounce", views.newAnnounce, name="newAnnounce")
...
...
widget_django_unchained/announcements/views.py
View file @
eb72774a
...
@@ -5,6 +5,7 @@ from .models import Announcement, Reaction
...
@@ -5,6 +5,7 @@ from .models import Announcement, Reaction
from
homepage.models
import
WidgetUser
from
homepage.models
import
WidgetUser
import
datetime
import
datetime
from
.forms
import
AnnouncementForm
from
.forms
import
AnnouncementForm
from
django.views
import
View
# Create your views here.
# Create your views here.
...
@@ -15,6 +16,14 @@ def index(request):
...
@@ -15,6 +16,14 @@ def index(request):
}
}
return
render
(
request
,
"announcement/announcement_page.html"
,
context
)
return
render
(
request
,
"announcement/announcement_page.html"
,
context
)
class
showAnnouncements
(
View
):
def
get
(
self
,
request
):
announce_list
=
Announcement
.
objects
.
order_by
(
"pub_date"
)
context
=
{
"announce_list"
:
announce_list
,
}
return
render
(
request
,
"announcement/announcement_page.html"
,
context
)
def
add
(
request
):
def
add
(
request
):
author
=
WidgetUser
.
objects
.
all
()
author
=
WidgetUser
.
objects
.
all
()
context
=
{
context
=
{
...
...
widget_django_unchained/db.sqlite3
View file @
eb72774a
No preview for this file type
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