Commit 68a836cf by Serbaf

convert coordinates to dict

parent 988d80a1
...@@ -85,3 +85,5 @@ Version 0.5.2: ...@@ -85,3 +85,5 @@ Version 0.5.2:
Added method to get Tweet in JSON form Added method to get Tweet in JSON form
Version 0.5.3: Version 0.5.3:
Coordinates stored as list and not as str Coordinates stored as list and not as str
Version 0.5.4:
Minor fix
...@@ -51,6 +51,6 @@ setup( ...@@ -51,6 +51,6 @@ setup(
test_suite='tests', test_suite='tests',
tests_require=test_requirements, tests_require=test_requirements,
url='https://github.com/Serbaf/tweet_model', url='https://github.com/Serbaf/tweet_model',
version='0.5.3', version='0.5.4',
zip_safe=False, zip_safe=False,
) )
...@@ -223,7 +223,11 @@ class Tweet(): ...@@ -223,7 +223,11 @@ class Tweet():
# Coordinates object # Coordinates object
self.coordinates = {} self.coordinates = {}
self.coordinates["coordinates"] = json.loads(coordinates__coordinates) try:
self.coordinates["coordinates"] =\
json.loads(coordinates__coordinates)
except TypeError:
self.coordinates["coordinates"] = coordinates__coordinates
self.coordinates["type"] = coordinates__type self.coordinates["type"] = coordinates__type
# Place object # Place object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment