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
11fb83f0
Commit
11fb83f0
authored
Aug 19, 2016
by
Aron Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified v0.2 API response JSON structure
parent
b583d728
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/web/views/shelterapiv02.py
src/web/views/shelterapiv02.py
+8
-8
No files found.
src/web/views/shelterapiv02.py
View file @
11fb83f0
...
...
@@ -137,23 +137,23 @@ def allshelters(shelter_id=None):
if
request
.
args
.
get
(
'format'
)
==
'prettytext'
:
for
shelter_property
in
shelter_properties
:
result
[
shelter_property
.
shelter_id
][
shelter_property
.
supercategory_name
][
shelter_property
.
category_name
][
shelter_property
.
name
]
=
shelter_property
.
value
result
[
shelter_property
.
shelter_id
][
shelter_property
.
supercategory_name
][
"Attributes"
][
shelter_property
.
name
]
=
shelter_property
.
value
for
picture
in
shelter_pictures
:
if
not
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
]:
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
]
=
[
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Identification
"
][
"ID"
],
picture
.
filename
)]
if
not
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
]:
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
]
=
[
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Attributes
"
][
"ID"
],
picture
.
filename
)]
else
:
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
].
append
(
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Identification
"
][
"ID"
],
picture
.
filename
))
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
].
append
(
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Attributes
"
][
"ID"
],
picture
.
filename
))
else
:
for
shelter_property
in
shelter_properties
:
result
[
shelter_property
.
shelter_id
][
shelter_property
.
supercategory_name
][
shelter_property
.
category_name
][
shelter_property
.
uniqueid
]
=
shelter_property
.
value
result
[
shelter_property
.
shelter_id
][
shelter_property
.
supercategory_name
][
"Attributes"
][
shelter_property
.
uniqueid
]
=
shelter_property
.
value
for
picture
in
shelter_pictures
:
if
not
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
]:
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
]
=
[
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Identification
"
][
"id"
],
picture
.
filename
)]
if
not
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
]:
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
]
=
[
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Attributes
"
][
"id"
],
picture
.
filename
)]
else
:
result
[
picture
.
shelter_id
][
"shelterpicture"
][
picture
.
name
].
append
(
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Identification
"
][
"id"
],
picture
.
filename
))
result
[
picture
.
shelter_id
][
picture
.
name
][
"Pictures"
].
append
(
"{}/{}/{}"
.
format
(
picpath
,
result
[
picture
.
shelter_id
][
"Identification"
][
"Attributes
"
][
"id"
],
picture
.
filename
))
return
jsonify
(
result
)
...
...
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