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
4bdab473
Commit
4bdab473
authored
Nov 07, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make string literal enclosures consistent
parent
5b869564
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
api.py
canteeneo/api.py
+2
-2
views.py
canteeneo/views.py
+3
-3
run.py
run.py
+1
-1
No files found.
canteeneo/api.py
View file @
4bdab473
...
@@ -31,7 +31,7 @@ def all():
...
@@ -31,7 +31,7 @@ def all():
@
app
.
route
(
'/api/search/dish'
)
@
app
.
route
(
'/api/search/dish'
)
def
search
():
def
search
():
query
=
request
.
args
.
get
(
'name'
)
query
=
request
.
args
.
get
(
'name'
)
result
=
Dish
.
query
.
filter
(
Dish
.
name
.
like
(
"
%
"
+
query
+
"
%
"
))
.
all
()
result
=
Dish
.
query
.
filter
(
Dish
.
name
.
like
(
'
%
'
+
query
+
'
%
'
))
.
all
()
data
=
[]
data
=
[]
for
dish
in
result
:
for
dish
in
result
:
data
.
append
({
data
.
append
({
...
@@ -43,7 +43,7 @@ def search():
...
@@ -43,7 +43,7 @@ def search():
})
})
return
jsonify
(
data
)
return
jsonify
(
data
)
@
app
.
route
(
'/api/users/new'
,
methods
=
[
"POST"
])
@
app
.
route
(
'/api/users/new'
,
methods
=
[
'POST'
])
def
new_user
():
def
new_user
():
username
=
request
.
form
[
'username'
]
username
=
request
.
form
[
'username'
]
email
=
request
.
form
[
'email'
]
email
=
request
.
form
[
'email'
]
...
...
canteeneo/views.py
View file @
4bdab473
...
@@ -66,7 +66,7 @@ def stall(stall_id):
...
@@ -66,7 +66,7 @@ def stall(stall_id):
dishes
=
stall
.
dishes
.
all
()
dishes
=
stall
.
dishes
.
all
()
return
render_template
(
'stall.html'
,
stall
=
stall
,
dishes
=
dishes
,
upload_folder
=
app
.
config
[
'UPLOAD_FOLDER'
])
return
render_template
(
'stall.html'
,
stall
=
stall
,
dishes
=
dishes
,
upload_folder
=
app
.
config
[
'UPLOAD_FOLDER'
])
@
app
.
route
(
'/stalls/new'
,
methods
=
[
"GET"
,
"POST"
])
@
app
.
route
(
'/stalls/new'
,
methods
=
[
'GET'
,
'POST'
])
@
login_required
@
login_required
def
new_stall
():
def
new_stall
():
form
=
StallRegisterForm
()
form
=
StallRegisterForm
()
...
@@ -123,7 +123,7 @@ def delete_stall(stall_id):
...
@@ -123,7 +123,7 @@ def delete_stall(stall_id):
return
redirect
(
url_for
(
'stalls'
))
return
redirect
(
url_for
(
'stalls'
))
@
app
.
route
(
'/stalls/<int:stall_id>/dish/new'
,
methods
=
[
"GET"
,
"POST"
])
@
app
.
route
(
'/stalls/<int:stall_id>/dish/new'
,
methods
=
[
'GET'
,
'POST'
])
@
login_required
@
login_required
def
new_dish
(
stall_id
):
def
new_dish
(
stall_id
):
stall
=
Stall
.
query
.
filter_by
(
id
=
int
(
stall_id
))
.
first
()
stall
=
Stall
.
query
.
filter_by
(
id
=
int
(
stall_id
))
.
first
()
...
@@ -205,4 +205,4 @@ def unauthorized():
...
@@ -205,4 +205,4 @@ def unauthorized():
def
flash_form_errors
(
form
):
def
flash_form_errors
(
form
):
for
field
,
errors
in
form
.
errors
.
items
():
for
field
,
errors
in
form
.
errors
.
items
():
for
error
in
errors
:
for
error
in
errors
:
flash
(
u
"Error in the
%
s field -
%
s"
%
(
getattr
(
form
,
field
)
.
label
.
text
,
error
))
flash
(
u
'Error in the
%
s field -
%
s'
%
(
getattr
(
form
,
field
)
.
label
.
text
,
error
))
run.py
View file @
4bdab473
from
canteeneo
import
app
from
canteeneo
import
app
app
.
run
(
host
=
"0.0.0.0"
,
port
=
5000
,
debug
=
True
)
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
)
\ No newline at end of file
\ No newline at end of file
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