Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
1
111
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yi Yang
111
Commits
41e202c9
Commit
41e202c9
authored
2 months ago
by
Yi Yang
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
23685327
No related branches found
No related tags found
1 merge request
!1
Upload New File
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes.py
+40
-0
40 additions, 0 deletions
routes.py
with
40 additions
and
0 deletions
routes.py
0 → 100644
+
40
−
0
View file @
41e202c9
from
movie_lib
import
app
,
db
from
movie_lib.models
import
*
from
flask
import
render_template
@app.route
(
"
/
"
)
def
hello_world
():
return
render_template
(
'
home.html
'
)
@app.route
(
"
/movie/<movieid>
"
)
def
movie_load
(
movieid
):
movie_found
=
MovieDAO
.
MovieById
(
movieid
,
db
)
return
render_template
(
'
movie.html
'
,
movie
=
movie_found
)
@app.route
(
"
/movies
"
)
def
list_movies
():
found_movies
=
MovieDAO
.
allMovies
(
db
)
return
render_template
(
'
movies_list.html
'
,
movies
=
found_movies
)
@app.route
(
"
/actors
"
)
def
list_actors
():
found_actors
=
ActorDAO
.
allActors
(
db
)
return
render_template
(
'
actors_list.html
'
,
actors
=
found_actors
)
@app.route
(
"
/actor/<actorid>
"
)
def
actor_load
(
actorid
):
found_actor
=
ActorDAO
.
actorById
(
actorid
,
db
=
db
)
return
render_template
(
'
actor.html
'
,
actor
=
found_actor
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment