Put the album.photos attribute back, since this is used for album.view when includeElements=True.

This commit is contained in:
sneakypete81 2013-09-07 11:44:03 +01:00
parent 533c2661b1
commit ba9ef81ac8
2 changed files with 20 additions and 7 deletions

View file

@ -8,6 +8,7 @@ from .photo import Photo
class Album(TroveboxObject):
""" Representation of an Album object """
def __init__(self, trovebox, json_dict):
self.photos = None
self.cover = None
TroveboxObject.__init__(self, trovebox, json_dict)
self._update_fields_with_objects()
@ -17,6 +18,11 @@ class Album(TroveboxObject):
# Update the cover with a photo object
if isinstance(self.cover, dict):
self.cover = Photo(self._trovebox, self.cover)
# Update the photo list with photo objects
if isinstance(self.photos, list):
for i, photo in enumerate(self.photos):
if isinstance(photo, dict):
self.photos[i] = Photo(self._trovebox, photo)
def delete(self, **kwds):
"""