Refactor the smarts into the api classes.
The object classes are now simple wrappers. Improve parameter testing, by passing foo="bar" where possible.
This commit is contained in:
parent
7a7b43afc7
commit
86ba0914c8
18 changed files with 307 additions and 316 deletions
|
@ -1,8 +1,6 @@
|
|||
"""
|
||||
Representation of an Activity object
|
||||
"""
|
||||
import json
|
||||
|
||||
from .trovebox_object import TroveboxObject
|
||||
from .photo import Photo
|
||||
|
||||
|
@ -33,12 +31,7 @@ class Activity(TroveboxObject):
|
|||
Requests the full contents of the activity.
|
||||
Updates the activity's fields with the response.
|
||||
"""
|
||||
result = self._client.get("/activity/%s/view.json" %
|
||||
self.id, **kwds)["result"]
|
||||
|
||||
# TBD: Why is the result enclosed/encoded like this?
|
||||
result = result["0"]
|
||||
result["data"] = json.loads(result["data"])
|
||||
|
||||
self._replace_fields(result)
|
||||
result = self._client.activity.view(self, **kwds)
|
||||
self._replace_fields(result.get_fields())
|
||||
self._update_fields_with_objects()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue