Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Bullet Journal
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
Franz Leonard Atanacio
Bullet Journal
Commits
005385ee
Commit
005385ee
authored
Apr 09, 2021
by
nikkastra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in the middle of thisweek.html
parent
b82139f2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
9 deletions
+108
-9
forms.cpython-38.pyc
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
+0
-0
models.cpython-38.pyc
mysite/bulletjournal/__pycache__/models.cpython-38.pyc
+0
-0
views.cpython-38.pyc
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
mysite/bulletjournal/forms.py
+12
-1
0005_auto_20210409_2301.py
mysite/bulletjournal/migrations/0005_auto_20210409_2301.py
+19
-0
0005_auto_20210409_2301.cpython-38.pyc
...ations/__pycache__/0005_auto_20210409_2301.cpython-38.pyc
+0
-0
models.py
mysite/bulletjournal/models.py
+5
-2
views.py
mysite/bulletjournal/views.py
+35
-1
name_detail.html
mysite/mysite/templates/bulletjournal/name_detail.html
+2
-2
key.html
mysite/mysite/templates/key.html
+1
-0
thisweek.html
mysite/mysite/templates/thisweek.html
+34
-3
No files found.
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
View file @
005385ee
No preview for this file type
mysite/bulletjournal/__pycache__/models.cpython-38.pyc
View file @
005385ee
No preview for this file type
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
View file @
005385ee
No preview for this file type
mysite/bulletjournal/forms.py
View file @
005385ee
...
...
@@ -23,3 +23,14 @@ class Keys(forms.ModelForm):
class
Meta
:
model
=
Key
fields
=
[
'key'
,
'description'
]
class
Task
(
forms
.
ModelForm
):
class
Meta
:
model
=
Tasks
fields
=
[
'key'
,
'task'
]
class
EditTask
(
forms
.
Form
):
edittask
=
forms
.
CharField
(
label
=
''
,
max_length
=
100
,
required
=
False
)
\ No newline at end of file
mysite/bulletjournal/migrations/0005_auto_20210409_2301.py
0 → 100644
View file @
005385ee
# Generated by Django 3.1.7 on 2021-04-09 15:01
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bulletjournal'
,
'0004_auto_20210409_2002'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'tasks'
,
name
=
'key'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'bulletjournal.key'
),
),
]
mysite/bulletjournal/migrations/__pycache__/0005_auto_20210409_2301.cpython-38.pyc
0 → 100644
View file @
005385ee
File added
mysite/bulletjournal/models.py
View file @
005385ee
...
...
@@ -28,5 +28,8 @@ class Key(models.Model):
class
Tasks
(
models
.
Model
):
name
=
models
.
ForeignKey
(
Name
,
on_delete
=
models
.
CASCADE
)
key
=
models
.
CharField
(
max_length
=
2
)
key
=
models
.
ForeignKey
(
Key
,
on_delete
=
models
.
CASCADE
)
task
=
models
.
CharField
(
max_length
=
100
)
def
__str__
(
self
):
return
'{}: {}'
.
format
(
self
.
key
,
self
.
task
)
\ No newline at end of file
mysite/bulletjournal/views.py
View file @
005385ee
...
...
@@ -9,6 +9,8 @@ from .models import *
name_dict
=
{}
#oh la la wow wow wee wa king in the castle king in the castle i have a chair i
#have a chair o go to this go to this hey king in the castle
class
NameListView
(
ListView
):
...
...
@@ -107,7 +109,39 @@ def key(request):
def
thisweek
(
request
):
return
render
(
request
,
'thisweek.html'
)
this_dict
=
{}
new_task
=
''
if
request
.
method
==
'POST'
:
form1
=
Task
(
request
.
POST
)
form2
=
EditTask
(
request
.
POST
)
if
form1
.
is_valid
()
or
form2
.
is_valid
():
x
=
''
for
y
in
request
.
POST
:
x
=
y
if
x
==
'task'
:
new_task
=
Tasks
(
name
=
Name
.
objects
.
get
(
name
=
name_dict
[
'name'
]),
key
=
form1
.
cleaned_data
[
'key'
],
task
=
form1
.
cleaned_data
[
'task'
])
new_task
.
save
()
the_tasks
=
[
str
(
x
)
for
x
in
Tasks
.
objects
.
all
()]
this_dict
[
'form1'
]
=
form1
this_dict
[
'form2'
]
=
form2
this_dict
[
'the_tasks'
]
=
the_tasks
return
render
(
request
,
'thisweek.html'
,
this_dict
)
elif
x
==
'edittask'
:
new_task
.
task
=
request
.
POST
[
'edittask'
]
new_task
.
save
()
the_tasks
=
[
str
(
x
)
for
x
in
Tasks
.
objects
.
all
()]
this_dict
[
'form1'
]
=
form1
this_dict
[
'form2'
]
=
form2
this_dict
[
'the_tasks'
]
=
the_tasks
return
render
(
request
,
'thisweek.html'
,
this_dict
)
else
:
form1
=
Task
()
form2
=
EditTask
()
the_tasks
=
[
str
(
x
)
for
x
in
Tasks
.
objects
.
all
()]
this_dict
[
'form1'
]
=
form1
this_dict
[
'form2'
]
=
form2
this_dict
[
'the_tasks'
]
=
the_tasks
return
render
(
request
,
'thisweek.html'
,
this_dict
)
def
today
(
request
):
...
...
mysite/mysite/templates/bulletjournal/name_detail.html
View file @
005385ee
{% extends 'base.html' %}
{% block title %}{{
N
ame.name }}{% endblock %}
{% block title %}{{
n
ame.name }}{% endblock %}
{% block content %}
<h1>
{{
Name
.name }}
</h1>
<h1>
{{
object
.name }}
</h1>
<p>
kung ano man to
</p>
{% endblock %}
\ No newline at end of file
mysite/mysite/templates/key.html
View file @
005385ee
...
...
@@ -13,6 +13,7 @@
{% for x in the_keys %}
<li>
{{x}}
</li>
{% endfor %}
{% else %}
...
...
mysite/mysite/templates/thisweek.html
View file @
005385ee
...
...
@@ -9,7 +9,38 @@
{% block content %}
<h1>
This Week
</h1>
<p>
03.29.MON - 04.04.SUN
</p>
<p>
- relax, holy week ngayon
</p>
<p>
● minecraft
</p>
<p>
- this is fake of course, go do your reqs
</p>
<ul>
{% if the_tasks %}
{% for x in the_tasks %}
{{forloop.counter}}
<li>
{{x}}
<button
type=
'button'
onclick=
'document.getElementById("edit").open="open"'
>
Edit
</button>
<button
type=
'button'
onclick=
'document.getElementById("delete").open="open"'
>
Delete
</button>
</li>
{% endfor %}
{% endif %}
</ul>
<button
type=
'button'
onclick=
'document.getElementById("add").open="open"'
>
Add Item
</button>
<dialog
id=
"add"
>
<form
action=
'{% url "thisweek" %}'
method=
'post'
>
{% csrf_token %}
{{form1}}
<input
type=
"Submit"
value=
"Add Task"
>
</form>
</dialog>
<dialog
id=
"edit"
>
<form
action=
'{% url "thisweek" %}'
method=
'post'
>
{% csrf_token %}
{{form2}}
<input
type=
"Submit"
value=
"Update"
>
</form>
</dialog>
<dialog
id=
"delete"
>
<form
action=
'{% url "thisweek" %}'
method=
'post'
>
{% csrf_token %}
{{form}}
<input
type=
"Submit"
value=
"Add Task"
>
</form>
</dialog>
{% endblock %}
\ No newline at end of file
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