From edc8d9ba97bb0999566532c54278694c8e4243f0 Mon Sep 17 00:00:00 2001 From: Ammaar Esmailjee Date: Thu, 16 Apr 2020 17:17:25 -0400 Subject: [PATCH] missing field on Image resource * add the variation_id field to the Image resoure. * cleanup up the formatting --- gapipy/resources/tour/image.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/gapipy/resources/tour/image.py b/gapipy/resources/tour/image.py index 180e55f..d6659f7 100644 --- a/gapipy/resources/tour/image.py +++ b/gapipy/resources/tour/image.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -# Python 2 and 3 from __future__ import unicode_literals from ..base import Resource @@ -16,7 +15,10 @@ class ImageFile(BaseModel): _as_is_fields = [ - 'url', 'data', 'mime_type', 'exif', + 'url', + 'data', + 'mime_type', + 'exif', ] @@ -25,9 +27,24 @@ class Image(Resource): _resource_name = 'images' _as_is_fields = [ - 'id', 'href', 'modification', 'description', 'keywords', - 'attribution', 'channels', 'variations', 'type', + 'id', + 'href', + 'variation_id', + 'attribution', + 'channels', + 'description', + 'keywords', + 'modification', + 'type', + 'variations', + ] + _date_time_fields_local = [ + 'date_created', + 'date_last_modified', + ] + _resource_fields = [ + ('original', 'Image'), + ] + _model_fields = [ + ('file', ImageFile), ] - _date_time_fields_local = ['date_created', 'date_last_modified'] - _resource_fields = [('original', 'Image')] - _model_fields = [('file', ImageFile)]