Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
production
building-knowledge-centre
building-dao
Commits
9ef8e9a9
Commit
9ef8e9a9
authored
Oct 19, 2020
by
unknown
Browse files
add str and repr methods
parent
9acd8d5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
building_dao/building_generic.py
building_dao/building_generic.py
+17
-0
No files found.
building_dao/building_generic.py
View file @
9ef8e9a9
...
...
@@ -59,6 +59,23 @@ class BuildingGeneric:
def
__setitem__
(
self
,
key
,
item
):
self
.
_building
[
key
]
=
item
def
__str__
(
self
):
return
"id: {id}, address: {address}, country_code: {country_code}, already_exists: {already_exists}"
.
format
(
id
=
self
.
_building
[
"id"
],
address
=
self
.
_building
[
"address"
][
"unstructured_query"
],
country_code
=
self
.
_building
[
"address"
][
"country_code"
],
already_exists
=
self
.
_building
[
"already_exists"
]
)
def
__repr__
(
self
):
return
"id: {id}, address: {address}, country_code: {country_code}, already_exists: {already_exists}"
.
format
(
id
=
self
.
_building
[
"id"
],
address
=
self
.
_building
[
"address"
][
"unstructured_query"
],
country_code
=
self
.
_building
[
"address"
][
"country_code"
],
already_exists
=
self
.
_building
[
"already_exists"
]
)
# ----------------- Building level ---------------------
def
post_building
(
self
,
payload
)
->
None
:
"""Post a new building"""
...
...
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