Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
brendanfausto_music
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
Brendan Fausto
brendanfausto_music
Commits
d227cad9
Commit
d227cad9
authored
Feb 16, 2023
by
Brendan Fausto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
About & Models finished, app integrated to project
parent
e46bcd0c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
3 deletions
+37
-3
models.py
brendanfausto_music/about/models.py
+21
-1
urls.py
brendanfausto_music/about/urls.py
+9
-0
views.py
brendanfausto_music/about/views.py
+4
-1
settings.py
brendanfausto_music/brendanfausto_music/settings.py
+1
-0
urls.py
brendanfausto_music/brendanfausto_music/urls.py
+2
-1
No files found.
brendanfausto_music/about/models.py
View file @
d227cad9
from
django.db
import
models
# Create your models here.
class
Artist
(
models
.
Model
):
#java eq: class IndexCard extends models.Model
artist_name
=
models
.
CharField
(
max_length
=
255
)
monthly_listeners
=
models
.
IntegerField
()
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
'Artist'
,
on_delete
=
models
.
PROTECT
)
description
=
models
.
TextField
()
release_date
=
models
.
DateField
()
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
'Artist'
,
on_delete
=
models
.
PROTECT
)
album
=
models
.
ForeignKey
(
'Album'
,
on_delete
=
models
.
PROTECT
)
song_length
=
models
.
TimeField
()
\ No newline at end of file
brendanfausto_music/about/urls.py
0 → 100644
View file @
d227cad9
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
app_name
=
"about"
# for proper namespacing in urls, otherwise will result in errors
\ No newline at end of file
brendanfausto_music/about/views.py
View file @
d227cad9
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
def
index
(
request
):
return
HttpResponse
(
"My name is Brendan Gabrielle M. Fausto, and I
\'
m a 3rd year BS CS student.
\n
My music preferences are very broad, from indie pop to R&B and the occasional metal."
)
# Create your views here.
brendanfausto_music/brendanfausto_music/settings.py
View file @
d227cad9
...
...
@@ -45,6 +45,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles'
,
'homepage'
,
'contact'
'about'
]
MIDDLEWARE
=
[
...
...
brendanfausto_music/brendanfausto_music/urls.py
View file @
d227cad9
...
...
@@ -19,5 +19,6 @@ from django.urls import path
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'homepage/'
,
include
(
'homepage.urls'
,
namespace
=
"homepage"
)),
path
(
'contact/'
,
include
(
'contact.urls'
,
namespace
=
"contact"
))
path
(
'contact/'
,
include
(
'contact.urls'
,
namespace
=
"contact"
)),
path
(
'about/'
,
include
(
'about.urls'
,
namespace
=
"about"
))
]
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