Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Shelter Database
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
CHARISM
Shelter Database
Commits
5f10d1cd
Commit
5f10d1cd
authored
Aug 24, 2016
by
Cédric Bonhomme
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/rodekruis/shelter-database
parents
219bc211
c4ed4b90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/web/views/shelterapiv02.py
src/web/views/shelterapiv02.py
+5
-5
No files found.
src/web/views/shelterapiv02.py
View file @
5f10d1cd
...
...
@@ -39,7 +39,7 @@ def worldmap():
with
app
.
open_resource
(
'static/data/countries.geojson'
)
as
f
:
data
=
json
.
load
(
f
,
encoding
=
'utf-8'
)
return
json
.
dumps
(
data
,
encoding
=
'
utf-8'
)
return
Response
(
json
.
dumps
(
data
),
mimetype
=
'application/json;charset=
utf-8'
)
#return app.send_static_file('data/world_borders.geojson')
@
apiv02_bp
.
route
(
'/attributes/<attribute_name>'
,
methods
=
[
'GET'
])
...
...
@@ -62,7 +62,7 @@ def available_translations():
#for language in available_languages
result
[
"languages"
]
=
available_languages
[
0
]
return
jsonify
(
result
)
return
Response
(
json
.
dumps
(
result
,
indent
=
3
),
mimetype
=
'application/json;charset=utf-8'
)
@
apiv02_bp
.
route
(
'/translation/<language>'
,
methods
=
[
'GET'
])
...
...
@@ -70,9 +70,9 @@ def translations(language=None):
result
=
tree
()
query
=
Translation
.
query
.
filter
(
Translation
.
language_code
==
language
)
for
item
in
query
:
result
[
item
.
original
]
=
item
.
translated
phrases
=
query
for
phrase
in
phrases
:
result
[
phrase
.
original
]
=
phrase
.
translated
return
Response
(
json
.
dumps
(
result
,
indent
=
3
),
mimetype
=
'application/json;charset=utf-8'
)
...
...
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