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
049de075
Commit
049de075
authored
Apr 07, 2021
by
nikkastra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
homepage done
parent
16f895ac
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
9 deletions
+16
-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
urls.cpython-38.pyc
mysite/bulletjournal/__pycache__/urls.cpython-38.pyc
+0
-0
views.cpython-38.pyc
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
mysite/bulletjournal/forms.py
+1
-1
default.jpg
mysite/bulletjournal/profile pictures/default.jpg
+0
-0
urls.py
mysite/bulletjournal/urls.py
+1
-1
views.py
mysite/bulletjournal/views.py
+14
-7
No files found.
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
View file @
049de075
No preview for this file type
mysite/bulletjournal/__pycache__/models.cpython-38.pyc
View file @
049de075
No preview for this file type
mysite/bulletjournal/__pycache__/urls.cpython-38.pyc
View file @
049de075
No preview for this file type
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
View file @
049de075
No preview for this file type
mysite/bulletjournal/forms.py
View file @
049de075
from
django
import
forms
class
IndexCardForm
(
forms
.
Form
):
class
FirstName
(
forms
.
Form
):
name
=
forms
.
CharField
(
label
=
"Hello! What is your name? "
,
max_length
=
100
)
\ No newline at end of file
mysite/bulletjournal/profile pictures/default.jpg
0 → 100644
View file @
049de075
134 KB
mysite/bulletjournal/urls.py
View file @
049de075
...
...
@@ -5,7 +5,7 @@ from .views import *
urlpatterns
=
[
path
(
''
,
HomePageView
.
as_view
(),
name
=
'index'
),
path
(
'home'
,
index_card_view
,
name
=
'home'
),
path
(
'home'
,
home
,
name
=
'home'
),
path
(
'profile'
,
profile
,
name
=
'profile'
),
path
(
'key'
,
key
,
name
=
'key'
),
path
(
'this_week'
,
thisweek
,
name
=
'thisweek'
),
...
...
mysite/bulletjournal/views.py
View file @
049de075
...
...
@@ -7,8 +7,10 @@ from django.views.generic.detail import DetailView
from
.forms
import
*
from
.models
import
*
name_dict
=
{}
class
NameListView
(
ListView
):
model
=
Name
...
...
@@ -19,20 +21,25 @@ class NameDetailView(DetailView):
class
HomePageView
(
View
):
def
get
(
self
,
request
):
form
=
IndexCardForm
()
form
=
FirstName
()
return
render
(
request
,
'index.html'
,
{
'form'
:
form
})
def
index_card_view
(
request
):
global
name_dict
if
len
(
name_dict
)
==
1
:
def
home
(
request
):
if
len
(
name_dict
)
==
1
:
return
render
(
request
,
'index.html'
,
name_dict
)
elif
request
.
method
==
'POST'
:
form
=
IndexCardForm
(
request
.
POST
)
form
=
FirstName
(
request
.
POST
)
if
form
.
is_valid
():
name_dict
[
'name'
]
=
form
.
cleaned_data
[
'name'
]
return
render
(
request
,
'index.html'
,
name_dict
)
try
:
if
Name
.
objects
.
get
(
name
=
name_dict
[
'name'
])
in
Name
.
objects
.
all
():
return
render
(
request
,
'index.html'
,
name_dict
)
except
:
person_info
=
Name
(
name
=
name_dict
[
'name'
],
nickname
=
'no nickname'
,
bio
=
'no bio'
)
person_info
.
save
()
return
render
(
request
,
'index.html'
,
name_dict
)
else
:
form
=
IndexCardForm
()
form
=
FirstName
()
return
render
(
request
,
'index.html'
,
{
'form'
:
form
})
...
...
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