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
26a75142
Commit
26a75142
authored
Nov 15, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more syntax errors
parent
03a1c257
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
dish_views.py
canteeneo/dish_views.py
+2
-1
stall_views.py
canteeneo/stall_views.py
+3
-3
No files found.
canteeneo/dish_views.py
View file @
26a75142
...
@@ -42,6 +42,7 @@ class EditDishView(FormView):
...
@@ -42,6 +42,7 @@ class EditDishView(FormView):
self
.
dish
=
Dish
.
query
.
get
(
dish_id
)
self
.
dish
=
Dish
.
query
.
get
(
dish_id
)
return
FormView
.
dispatch_request
(
self
,
stall_id
=
stall_id
,
dish_id
=
dish_id
)
return
FormView
.
dispatch_request
(
self
,
stall_id
=
stall_id
,
dish_id
=
dish_id
)
def
render_post
(
self
,
stall_id
,
dish_id
):
def
render_post
(
self
,
stall_id
,
dish_id
):
form
=
self
.
get_form
()
self
.
dish
.
name
=
form
.
name
.
data
self
.
dish
.
name
=
form
.
name
.
data
self
.
dish
.
description
=
form
.
description
.
data
self
.
dish
.
description
=
form
.
description
.
data
self
.
dish
.
price
=
form
.
price
.
data
self
.
dish
.
price
=
form
.
price
.
data
...
@@ -49,7 +50,7 @@ class EditDishView(FormView):
...
@@ -49,7 +50,7 @@ class EditDishView(FormView):
self
.
dish
.
image_path
=
secure_filename
(
form
.
image
.
data
.
filename
)
self
.
dish
.
image_path
=
secure_filename
(
form
.
image
.
data
.
filename
)
form
.
image
.
data
.
save
(
os
.
path
.
join
(
app
.
config
[
'UPLOAD_FOLDER'
],
self
.
dish
.
image_path
))
form
.
image
.
data
.
save
(
os
.
path
.
join
(
app
.
config
[
'UPLOAD_FOLDER'
],
self
.
dish
.
image_path
))
db
.
session
.
commit
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
stall
.
id
))
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
s
elf
.
s
tall
.
id
))
def
render_get
(
self
,
stall_id
,
dish_id
):
def
render_get
(
self
,
stall_id
,
dish_id
):
form
.
name
.
data
=
self
.
dish
.
name
form
.
name
.
data
=
self
.
dish
.
name
form
.
description
.
data
=
self
.
dish
.
description
form
.
description
.
data
=
self
.
dish
.
description
...
...
canteeneo/stall_views.py
View file @
26a75142
...
@@ -16,8 +16,8 @@ class NewStallView(FormView):
...
@@ -16,8 +16,8 @@ class NewStallView(FormView):
decorators
=
[
login_required
]
decorators
=
[
login_required
]
def
render_post
(
self
):
def
render_post
(
self
):
form
=
self
.
get_form
()
form
=
self
.
get_form
()
stall
=
Stall
(
form
.
name
.
data
,
form
.
description
.
data
,
current_user
.
id
,
form
.
location
.
data
)
s
elf
.
s
tall
=
Stall
(
form
.
name
.
data
,
form
.
description
.
data
,
current_user
.
id
,
form
.
location
.
data
)
db
.
session
.
add
(
stall
)
db
.
session
.
add
(
s
elf
.
s
tall
)
db
.
session
.
commit
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
self
.
stall
.
id
))
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
self
.
stall
.
id
))
def
render_get
(
self
):
def
render_get
(
self
):
...
@@ -64,7 +64,7 @@ class DeleteStallView(View):
...
@@ -64,7 +64,7 @@ class DeleteStallView(View):
stall
=
Stall
.
query
.
get
(
stall_id
)
stall
=
Stall
.
query
.
get
(
stall_id
)
db
.
session
.
delete
(
stall
)
db
.
session
.
delete
(
stall
)
db
.
session
.
commit
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
'view_stall'
),
stall_id
=
stall_id
)
return
redirect
(
url_for
(
'view_stall'
,
stall_id
=
stall_id
)
)
app
.
add_url_rule
(
'/stalls'
,
view_func
=
StallListView
.
as_view
(
'stalls'
),
methods
=
[
'GET'
])
app
.
add_url_rule
(
'/stalls'
,
view_func
=
StallListView
.
as_view
(
'stalls'
),
methods
=
[
'GET'
])
app
.
add_url_rule
(
'/stalls/new'
,
view_func
=
NewStallView
.
as_view
(
'new_stall'
))
app
.
add_url_rule
(
'/stalls/new'
,
view_func
=
NewStallView
.
as_view
(
'new_stall'
))
...
...
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