Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS123-Canteeneo
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Willard Torres
CS123-Canteeneo
Commits
d519beb9
Commit
d519beb9
authored
Nov 15, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper dish_views.py formatting
parent
da1dcb2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
dish_views.py
canteeneo/dish_views.py
+4
-4
No files found.
canteeneo/dish_views.py
View file @
d519beb9
...
...
@@ -11,7 +11,7 @@ from flask_login import login_required
from
werkzeug.utils
import
secure_filename
class
NewDishView
(
FormView
):
decorators
=
[
login_required
,
stall_validate
]
decorators
=
[
login_required
,
stall_validate
]
def
dispatch_request
(
self
,
stall_id
):
self
.
stall
=
Stall
.
query
.
get
(
stall_id
)
return
FormView
.
dispatch_request
(
self
,
stall_id
)
...
...
@@ -28,12 +28,12 @@ class NewDishView(FormView):
return
DishRegisterForm
()
class
DishView
(
View
):
decorators
=
[
login_required
,
dish_validate
]
decorators
=
[
login_required
,
dish_validate
]
def
dispatch_request
(
self
,
stall_id
,
dish_id
):
return
render_template
(
'viewdish.html'
,
stall
=
Stall
.
query
.
get
(
stall_id
),
dish
=
Dish
.
query
.
get
(
dish_id
))
class
EditDishView
(
FormView
):
decorators
=
[
login_required
,
dish_validate
]
decorators
=
[
login_required
,
dish_validate
]
def
dispatch_request
(
self
,
stall_id
,
dish_id
):
self
.
stall
=
Stall
.
query
.
get
(
stall_id
)
self
.
dish
=
Dish
.
query
.
get
(
dish_id
)
...
...
@@ -56,7 +56,7 @@ class EditDishView(FormView):
return
DishRegisterForm
()
class
DeleteDishView
(
View
):
decorators
=
[
login_required
,
dish_validate
]
decorators
=
[
login_required
,
dish_validate
]
def
dispatch_request
(
self
,
stall_id
,
dish_id
):
dish
=
Dish
.
query
.
get
(
dish_id
)
db
.
session
.
delete
(
dish
)
...
...
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