Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_robo_mommy
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Raul Jarod Conanan
midterm_robo_mommy
Commits
1427b738
Commit
1427b738
authored
May 11, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported the new ModelForms and created class-based views to create or update data
parent
3ec06828
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
views.py
widget_robo_mommy/Assignments/views.py
+26
-2
No files found.
widget_robo_mommy/Assignments/views.py
View file @
1427b738
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
Assignment
from
django.shortcuts
import
render
from
django.views
import
View
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Assignment
,
Course
from
.forms
import
AssignmentForm
,
CourseForm
class
AssignmentDetailsView
(
DetailView
):
model
=
Assignment
template_name
=
'assignments/assignment-details.html'
class
AddAssignmentView
(
CreateView
):
model
=
Assignment
form_class
=
AssignmentForm
template_name
=
'assignments/assignment-add.html'
class
EditAssignmentView
(
UpdateView
):
model
=
Assignment
form_class
=
AssignmentForm
template_name
=
'assignments/assignment-edit.html'
def
index
(
request
):
def
index
(
request
):
output
=
f
"Widget's
A
ssignments Page<br><br>"
output
=
f
"Widget's
a
ssignments Page<br><br>"
count
=
Assignment
.
objects
.
all
()
.
count
()
count
=
Assignment
.
objects
.
all
()
.
count
()
for
i
in
range
(
1
,
count
+
1
):
for
i
in
range
(
1
,
count
+
1
):
...
...
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