Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mymusiclist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Brian Guadalupe
mymusiclist
Commits
ce1c94dc
Commit
ce1c94dc
authored
Nov 05, 2017
by
Deion Menor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix references to Artist,Song,Album in views
parent
6f20f5ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
views.py
core/views.py
+14
-14
No files found.
core/views.py
View file @
ce1c94dc
...
@@ -40,14 +40,14 @@ def search(request):
...
@@ -40,14 +40,14 @@ def search(request):
type
=
request
.
GET
.
get
(
'searchtype'
,
''
)
type
=
request
.
GET
.
get
(
'searchtype'
,
''
)
term
=
request
.
GET
.
get
(
'search'
,
''
)
term
=
request
.
GET
.
get
(
'search'
,
''
)
artistAlbums
=
a
lbum
.
objects
.
filter
(
artist__name__contains
=
term
)
artistAlbums
=
A
lbum
.
objects
.
filter
(
artist__name__contains
=
term
)
if
type
==
'song'
:
if
type
==
'song'
:
results
=
s
ong
.
objects
.
filter
(
song_name__contains
=
term
)
results
=
S
ong
.
objects
.
filter
(
song_name__contains
=
term
)
elif
type
==
'album'
:
elif
type
==
'album'
:
results
=
a
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
results
=
A
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
elif
type
==
'artist'
:
elif
type
==
'artist'
:
results
=
a
rtist
.
objects
.
filter
(
name__contains
=
term
)
results
=
A
rtist
.
objects
.
filter
(
name__contains
=
term
)
context
=
{
context
=
{
'type'
:
type
,
'type'
:
type
,
...
@@ -58,14 +58,14 @@ def search(request):
...
@@ -58,14 +58,14 @@ def search(request):
return
render
(
request
,
'search.html'
,
context
)
return
render
(
request
,
'search.html'
,
context
)
def
artist_profile
(
request
,
identifier
):
def
artist_profile
(
request
,
identifier
):
result
=
a
rtist
.
objects
.
filter
(
id
=
identifier
)
result
=
A
rtist
.
objects
.
filter
(
id
=
identifier
)
albums
=
a
lbum
.
objects
.
filter
(
artist
=
identifier
)
albums
=
A
lbum
.
objects
.
filter
(
artist
=
identifier
)
return
render
(
request
,
'artist.html'
,
{
'result'
:
result
[
0
],
'albums'
:
albums
})
return
render
(
request
,
'artist.html'
,
{
'result'
:
result
[
0
],
'albums'
:
albums
})
def
album_profile
(
request
,
identifier
):
def
album_profile
(
request
,
identifier
):
result
=
a
lbum
.
objects
.
filter
(
id
=
identifier
)
result
=
A
lbum
.
objects
.
filter
(
id
=
identifier
)
artist_name
=
result
[
0
]
.
a
rtist
.
name
artist_name
=
result
[
0
]
.
A
rtist
.
name
songs
=
s
ong
.
objects
.
filter
(
album
=
identifier
)
songs
=
S
ong
.
objects
.
filter
(
album
=
identifier
)
return
render
(
request
,
'album.html'
,
{
'result'
:
result
[
0
],
'songs'
:
songs
,
'artist'
:
artist_name
})
return
render
(
request
,
'album.html'
,
{
'result'
:
result
[
0
],
'songs'
:
songs
,
'artist'
:
artist_name
})
# def search(request,term):
# def search(request,term):
...
...
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