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
25e5399e
Commit
25e5399e
authored
Nov 15, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more syntax errors
parent
30ea4d5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
dish_views.py
canteeneo/dish_views.py
+2
-1
No files found.
canteeneo/dish_views.py
View file @
25e5399e
...
...
@@ -16,12 +16,13 @@ class NewDishView(FormView):
self
.
stall
=
Stall
.
query
.
get
(
stall_id
)
return
FormView
.
dispatch_request
(
self
,
stall_id
=
stall_id
)
def
render_post
(
self
,
stall_id
):
form
=
self
.
get_form
()
filename
=
secure_filename
(
form
.
image
.
data
.
filename
)
dish
=
Dish
(
form
.
name
.
data
,
form
.
description
.
data
,
form
.
price
.
data
,
self
.
stall
.
id
,
filename
)
form
.
image
.
data
.
save
(
os
.
path
.
join
(
app
.
config
[
'UPLOAD_FOLDER'
],
filename
))
db
.
session
.
add
(
dish
)
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
):
return
render_template
(
'newdish.html'
,
form
=
self
.
get_form
(),
stall
=
self
.
stall
)
def
get_form
(
self
):
...
...
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