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
d983635d
Commit
d983635d
authored
Apr 09, 2021
by
nikkastra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home and profile done
parent
7ecf0a1c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
58 additions
and
22 deletions
+58
-22
forms.cpython-38.pyc
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
+0
-0
views.cpython-38.pyc
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
mysite/bulletjournal/forms.py
+6
-4
views.py
mysite/bulletjournal/views.py
+33
-12
settings.cpython-38.pyc
mysite/mysite/__pycache__/settings.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
mysite/mysite/__pycache__/urls.cpython-38.pyc
+0
-0
asd.PNG
mysite/mysite/media/profilepictures/asd.PNG
+0
-0
monika__doki_doki_literature_club__by_detachsoul_dbwaah7-fullview.jpg
..._doki_literature_club__by_detachsoul_dbwaah7-fullview.jpg
+0
-0
picture_ko_para_sa_lahat_XcI00t2.jpg
...edia/profilepictures/picture_ko_para_sa_lahat_XcI00t2.jpg
+0
-0
settings.py
mysite/mysite/settings.py
+1
-0
profile.html
mysite/mysite/templates/profile.html
+17
-3
urls.py
mysite/mysite/urls.py
+1
-3
No files found.
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
View file @
d983635d
No preview for this file type
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
View file @
d983635d
No preview for this file type
mysite/bulletjournal/forms.py
View file @
d983635d
...
...
@@ -5,10 +5,12 @@ class FirstName(forms.Form):
name
=
forms
.
CharField
(
label
=
"Hello! What is your name? "
,
max_length
=
100
)
class
NicknameAndBio
(
forms
.
ModelForm
):
class
Meta
:
model
=
Name
fields
=
[
'nickname'
,
'bio'
]
class
Nickname
(
forms
.
Form
):
nickname
=
forms
.
CharField
(
label
=
""
,
max_length
=
100
,
required
=
False
)
class
Bio
(
forms
.
Form
):
bio
=
forms
.
CharField
(
label
=
''
,
max_length
=
100
,
required
=
False
)
class
Picture
(
forms
.
ModelForm
):
...
...
mysite/bulletjournal/views.py
View file @
d983635d
...
...
@@ -50,19 +50,40 @@ def profile(request):
nickname
=
info
.
nickname
bio
=
info
.
bio
if
request
.
method
==
"POST"
:
form
=
Picture
(
request
.
POST
,
request
.
FILES
)
if
form
.
is_valid
():
form
.
save
()
test
=
Name
.
objects
.
get
(
name
=
"test"
)
info
.
image
=
test
.
image
picture
=
info
.
image
info
.
save
()
test
.
delete
()
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form'
:
form
}
return
render
(
request
,
'profile.html'
,
info_dict
)
form1
=
Picture
(
request
.
POST
,
request
.
FILES
)
form2
=
Nickname
(
request
.
POST
)
form3
=
Bio
(
request
.
POST
)
if
form1
.
is_valid
()
or
form2
.
is_valid
()
or
form3
.
is_valid
():
if
len
(
request
.
FILES
)
==
1
:
form1
.
save
()
test
=
Name
.
objects
.
get
(
name
=
"test"
)
info
.
image
=
test
.
image
picture
=
info
.
image
info
.
save
()
test
.
delete
()
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form1'
:
form1
,
'form2'
:
form2
,
'form3'
:
form3
}
return
render
(
request
,
'profile.html'
,
info_dict
)
elif
len
(
request
.
POST
)
==
2
:
x
=
''
for
y
in
request
.
POST
:
x
=
y
if
x
==
'nickname'
:
info
.
nickname
=
request
.
POST
[
'nickname'
]
nickname
=
info
.
nickname
info
.
save
()
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form1'
:
form1
,
'form2'
:
form2
,
'form3'
:
form3
}
return
render
(
request
,
'profile.html'
,
info_dict
)
else
:
info
.
bio
=
request
.
POST
[
'bio'
]
bio
=
info
.
bio
info
.
save
()
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form1'
:
form1
,
'form2'
:
form2
,
'form3'
:
form3
}
return
render
(
request
,
'profile.html'
,
info_dict
)
else
:
form
=
Picture
()
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form'
:
form
}
form1
=
Picture
()
form2
=
Nickname
(
use_required_attribute
=
False
)
form3
=
Bio
(
use_required_attribute
=
False
)
info_dict
=
{
'name'
:
name_dict
[
'name'
],
'nickname'
:
nickname
,
'bio'
:
bio
,
'picture'
:
picture
,
'form1'
:
form1
,
'form2'
:
form2
,
'form3'
:
form3
}
return
render
(
request
,
'profile.html'
,
info_dict
)
...
...
mysite/mysite/__pycache__/settings.cpython-38.pyc
View file @
d983635d
No preview for this file type
mysite/mysite/__pycache__/urls.cpython-38.pyc
View file @
d983635d
No preview for this file type
mysite/mysite/media/profilepictures/asd.PNG
0 → 100644
View file @
d983635d
211 KB
mysite/mysite/media/profilepictures/monika__doki_doki_literature_club__by_detachsoul_dbwaah7-fullview.jpg
0 → 100644
View file @
d983635d
68.4 KB
mysite/mysite/media/profilepictures/picture_ko_para_sa_lahat_XcI00t2.jpg
0 → 100644
View file @
d983635d
52.2 KB
mysite/mysite/settings.py
View file @
d983635d
...
...
@@ -62,6 +62,7 @@ TEMPLATES = [
'context_processors'
:
[
'django.template.context_processors.debug'
,
'django.template.context_processors.request'
,
'django.template.context_processors.media'
,
'django.contrib.auth.context_processors.auth'
,
'django.contrib.messages.context_processors.messages'
,
],
...
...
mysite/mysite/templates/profile.html
View file @
d983635d
...
...
@@ -11,12 +11,26 @@
<img
src=
"{{picture}}"
alt=
"hindi ako lilitaw"
/>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
{% csrf_token %}
{{ form.as_p }}
{{ form
1
.as_p }}
<button
type=
'submit'
>
Change
</button>
</form>
<ul>
<li>
{{name}}
</li>
<li>
{{nickname}}
</li>
<li>
{{bio}}
</li>
<li>
{{nickname}}
<form
action=
"/profile"
method=
"POST"
id=
'nickname'
>
{% csrf_token %}
{{ form2 }}
<input
type=
'Submit'
value=
'Edit'
id=
'nickname'
>
</form>
</li>
<li>
{{bio}}
<form
action=
"/profile"
method=
"POST"
id=
'bio'
>
{% csrf_token %}
{{ form3 }}
<input
type=
'Submit'
value=
'Edit'
id=
'bio'
>
</form>
</li>
</ul>
{% endblock %}
\ No newline at end of file
mysite/mysite/urls.py
View file @
d983635d
...
...
@@ -23,6 +23,4 @@ from django.conf.urls.static import static
urlpatterns
=
[
path
(
''
,
include
(
'bulletjournal.urls'
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
\ No newline at end of file
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
\ 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