Skip to content

Commit

Permalink
Rename versions -> scales as recommended by davisagli.
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Mar 29, 2015
1 parent 9ebf074 commit 8f27c9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/source/_json/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"title": "Plone site"
},
"portal_type": "Image",
"title": "My Image",
"versions": {
"scales": {
"icon": "http://localhost:55001/plone/image/@@images/image/icon",
"large": "http://localhost:55001/plone/image/@@images/image/large",
"listing": "http://localhost:55001/plone/image/@@images/image/listing",
"mini": "http://localhost:55001/plone/image/@@images/image/mini",
"preview": "http://localhost:55001/plone/image/@@images/image/preview",
"thumb": "http://localhost:55001/plone/image/@@images/image/thumb",
"tile": "http://localhost:55001/plone/image/@@images/image/tile"
}
},
"title": "My Image"
}
2 changes: 1 addition & 1 deletion src/plone/restapi/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def SerializeImageToJson(context):
'title': context.title,
'description': context.description,
'download': '{0}/@@download'.format(context.absolute_url()),
'versions': {
'scales': {
x.split(' ')[0]: '{0}/@@images/image/{1}'.format(
context.absolute_url(),
x.split(' ')[0]
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_serialize_to_json_adapter_image(self):
)
self.assertEqual(
[u'mini', u'thumb', u'large', u'listing', u'tile', u'preview', u'icon'], # noqa
[x for x in json.loads(ISerializeToJson(self.portal.image1)).get('versions')] # noqa
[x for x in json.loads(ISerializeToJson(self.portal.image1)).get('scales')] # noqa
)

def test_serialize_to_json_collection(self):
Expand Down

0 comments on commit 8f27c9f

Please sign in to comment.