Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
Almira Redoble
midterm_vincentdjango
Commits
dfad8189
Commit
dfad8189
authored
Apr 29, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another solution for views and it still won't work
parent
4504933b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
27 deletions
+26
-27
.gitignore
.gitignore
+2
-2
assignments.html
...ntdjango/assignments/templates/templates/assignments.html
+1
-9
views.py
widget_vincentdjango/assignments/views.py
+4
-16
db.sqlite3
widget_vincentdjango/db.sqlite3
+0
-0
0007_alter_event_target_datetime.py
...t_calendar/migrations/0007_alter_event_target_datetime.py
+19
-0
No files found.
.gitignore
View file @
dfad8189
...
...
@@ -58,8 +58,8 @@ cover/
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
#
db.sqlite3
#
db.sqlite3-journal
# Flask stuff:
instance/
...
...
widget_vincentdjango/assignments/templates/templates/assignments.html
View file @
dfad8189
...
...
@@ -4,15 +4,7 @@
{% block pageTitle %}
<h1>
Assignments
</h1>
{% endblock %}
{% block content %}
<div
class=
"content"
>
<ul
style=
"list-style-type:square;"
>
{% for assignment in {{ assignmentsList }} %}
<li>
<div
class=
"assignmentLink"
>
<a
href=
"{{ assignment.get_absolute_url }}/details"
>
{{ assignment.assignment_name }}
</a>
</div>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{{ addition }}
{% block otherButtons %}
<div
class=
"content"
>
...
...
widget_vincentdjango/assignments/views.py
View file @
dfad8189
...
...
@@ -5,32 +5,20 @@ from .models import Assignment
def
homeAssignmentsPage
(
request
):
'''
context = {}
j = 0
for assignment in Assignment.objects.all():
context[str(j)]=assignment
j+=1
'''
starter
=
"{
%
block content
%
}
\
<div class='content'>
\
<ul style='list-style-type:square;'>
\n
"
middle
=
""
for
assignment
in
Assignment
.
objects
.
all
():
middle
+=
"<li> <div class='assignmentLink'> <a href='"
+
assignment
.
get_absolute_url
()
+
"'/details"
+
">"
+
assignment
.
assignment_name
+
" </a> </div> </li>"
middle
=
middle
+
"<li> <div class='assignmentLink'>
\
<a href='"
+
str
(
assignment
.
get_absolute_url
)
+
"'/details>"
+
str
(
assignment
.
assignment_name
)
+
" </a> </div> </li>"
ender
=
"</ul>
\
</div>
\
{
%
endblock
%
}"
output
=
starter
+
middle
+
ender
return
render
(
request
,
'templates/assignments.html'
,
{
"a
ssignmentList"
:
Assignmen
t
})
return
render
(
request
,
'templates/assignments.html'
,
{
"a
ddition"
:
outpu
t
})
def
index
(
request
):
...
...
widget_vincentdjango/db.sqlite3
View file @
dfad8189
No preview for this file type
widget_vincentdjango/widget_calendar/migrations/0007_alter_event_target_datetime.py
0 → 100644
View file @
dfad8189
# Generated by Django 3.2 on 2023-04-29 07:07
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'widget_calendar'
,
'0006_alter_event_target_datetime'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'event'
,
name
=
'target_datetime'
,
field
=
models
.
DateTimeField
(
default
=
datetime
.
datetime
(
2023
,
4
,
29
,
15
,
7
,
16
,
727183
)),
),
]
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