Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_k3git
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
Stefan Gomez
midterm_k3git
Commits
7565a8bd
Commit
7565a8bd
authored
May 15, 2023
by
MJoshBen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Edit Announcement and adjusted the Models. Views and URLs accordingly
parent
273425e9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
4 deletions
+23
-4
models.cpython-311.pyc
widget_k3git/announcement/__pycache__/models.cpython-311.pyc
+0
-0
urls.cpython-311.pyc
widget_k3git/announcement/__pycache__/urls.cpython-311.pyc
+0
-0
views.cpython-311.pyc
widget_k3git/announcement/__pycache__/views.cpython-311.pyc
+0
-0
models.py
widget_k3git/announcement/models.py
+0
-1
assignment-edit.html
.../announcement/templates/announcement/assignment-edit.html
+14
-0
urls.py
widget_k3git/announcement/urls.py
+3
-2
views.py
widget_k3git/announcement/views.py
+6
-1
No files found.
widget_k3git/announcement/__pycache__/models.cpython-311.pyc
View file @
7565a8bd
No preview for this file type
widget_k3git/announcement/__pycache__/urls.cpython-311.pyc
View file @
7565a8bd
No preview for this file type
widget_k3git/announcement/__pycache__/views.cpython-311.pyc
View file @
7565a8bd
No preview for this file type
widget_k3git/announcement/models.py
View file @
7565a8bd
from
django.db
import
models
from
dashboard.models
import
WidgetUser
from
django.urls
import
reverse
# Create your models here.
...
...
widget_k3git/announcement/templates/announcement/assignment-edit.html
0 → 100644
View file @
7565a8bd
{% extends 'base.html' %}
{% block title %}Edit Announcement{% endblock %}
<h1>
Edit Announcement:
</h1>
{% block content %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save Changes to Announcement"
>
</form>
{% endblock %}
{% block scripts %}
{% endblock %}
widget_k3git/announcement/urls.py
View file @
7565a8bd
from
django.contrib
import
admin
from
django.urls
import
path
from
.views
import
index
,
AnnouncementDetailView
,
AnnouncementCreateView
from
.views
import
index
,
AnnouncementDetailView
,
AnnouncementCreateView
,
AnnouncementUpdateView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
'<int:pk>/details'
,
AnnouncementDetailView
.
as_view
(),
name
=
'announcement-details'
),
path
(
'add/'
,
AnnouncementCreateView
.
as_view
(),
name
=
'add-announcement'
)
path
(
'add/'
,
AnnouncementCreateView
.
as_view
(),
name
=
'add-announcement'
),
path
(
'<int:pk>/edit'
,
AnnouncementUpdateView
.
as_view
(),
name
=
"edit-announcement"
)
]
app_name
=
"announcement"
widget_k3git/announcement/views.py
View file @
7565a8bd
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Announcement
...
...
@@ -18,3 +18,8 @@ class AnnouncementCreateView(CreateView):
fields
=
'__all__'
template_name
=
'announcement/announcement-add.html'
class
AnnouncementUpdateView
(
UpdateView
):
model
=
Announcement
fields
=
'__all__'
template_name
=
'announcement/announcement-edit.html'
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