diff --git a/CHANGES.rst b/CHANGES.rst index 1bf49035..61e390a2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Alterações 1.1rc2 (unreleased) ^^^^^^^^^^^^^^^^^^^ +- Adiciona plone.api como dependência. + [idgserpro] + - Adicionando opção de link no título do cabeçalho do HeaderTile (closes `#157`). [caduvieira] diff --git a/setup.py b/setup.py index b42cc747..0d2330bc 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ 'collective.polls', 'collective.prettydate', 'five.grok', + 'plone.api', 'plone.app.blocks', 'plone.app.dexterity [grok, relations]', 'plone.app.iterate', @@ -90,6 +91,7 @@ 'collective.cover[test]', 'mock', 'five.pt', + 'plone.api', 'plone.app.robotframework', 'plone.app.testing [robot] >=4.2.2', 'plone.browserlayer', diff --git a/src/brasil/gov/tiles/tests/test_albuns_tile.py b/src/brasil/gov/tiles/tests/test_albuns_tile.py index f9efbd0b..e6550f75 100644 --- a/src/brasil/gov/tiles/tests/test_albuns_tile.py +++ b/src/brasil/gov/tiles/tests/test_albuns_tile.py @@ -76,7 +76,7 @@ def test_get_albuns(self): self.tile.populate_with_object(gal_albuns) self.assertEqual(self.tile.get_albuns(), []) - gal_albuns.invokeFactory('Folder', 'galeria-de-fotos') + api.content.create(gal_albuns, 'Folder', 'galeria-de-fotos') gal_fotos = gal_albuns['galeria-de-fotos'] with api.env.adopt_roles(['Manager']): api.content.transition(obj=gal_fotos, transition='publish') diff --git a/src/brasil/gov/tiles/tests/test_basic.py b/src/brasil/gov/tiles/tests/test_basic.py index baae211b..f8ae36df 100644 --- a/src/brasil/gov/tiles/tests/test_basic.py +++ b/src/brasil/gov/tiles/tests/test_basic.py @@ -33,7 +33,7 @@ def test_default_configuration(self): def test_accepted_content_types(self): registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa self.assertEqual( self.tile.accepted_ct(), settings.searchable_content_types diff --git a/src/brasil/gov/tiles/tests/test_carousel.py b/src/brasil/gov/tiles/tests/test_carousel.py index c8d021af..de45f1df 100644 --- a/src/brasil/gov/tiles/tests/test_carousel.py +++ b/src/brasil/gov/tiles/tests/test_carousel.py @@ -46,7 +46,7 @@ def test_folder_tile_render(self): def test_accepted_content_types(self): # Using the same from ListTile since CarouselTile(ListTile) registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa self.assertEqual( self.tile.accepted_ct(), settings.searchable_content_types diff --git a/src/brasil/gov/tiles/tests/test_destaque_tile.py b/src/brasil/gov/tiles/tests/test_destaque_tile.py index 4e5c8286..a533869b 100644 --- a/src/brasil/gov/tiles/tests/test_destaque_tile.py +++ b/src/brasil/gov/tiles/tests/test_destaque_tile.py @@ -4,8 +4,8 @@ from brasil.gov.tiles.tiles.destaque import IDestaqueTile from collective.cover.controlpanel import ICoverSettings from collective.cover.tests.base import TestTileMixin +from plone import api from plone.registry.interfaces import IRegistry -from plone.uuid.interfaces import IUUID from zope.component import getMultiAdapter from zope.component import getUtility @@ -58,7 +58,7 @@ def test_crud(self): # next, we replace the destaque of objects with a different one obj3 = self.portal['my-news-item'] - tile.replace_with_objects([IUUID(obj3, None)]) + tile.replace_with_objects([api.content.get_uuid(obj3)]) # tile's data attributed is cached so we should re-instantiate the tile tile = getMultiAdapter( (self.cover, self.request), @@ -86,8 +86,8 @@ def test_populate_with_uuids(self): # now we add a couple of objects to the destaque obj1 = self.portal['my-document'] obj2 = self.portal['my-image'] - self.tile.populate_with_uuids([IUUID(obj1, None), - IUUID(obj2, None)]) + self.tile.populate_with_uuids([api.content.get_uuid(obj1), + api.content.get_uuid(obj2)]) # tile's data attributed is cached so we should re-instantiate the tile tile = getMultiAdapter( @@ -101,7 +101,7 @@ def test_populate_with_uuids(self): def test_accepted_content_types(self): registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa self.assertEqual( self.tile.accepted_ct(), settings.searchable_content_types diff --git a/src/brasil/gov/tiles/tests/test_header.py b/src/brasil/gov/tiles/tests/test_header.py index 6b387862..68c6270c 100644 --- a/src/brasil/gov/tiles/tests/test_header.py +++ b/src/brasil/gov/tiles/tests/test_header.py @@ -31,7 +31,7 @@ def test_default_configuration(self): def test_accepted_content_types(self): registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa self.assertEqual( self.tile.accepted_ct(), settings.searchable_content_types diff --git a/src/brasil/gov/tiles/tiles/albuns.py b/src/brasil/gov/tiles/tiles/albuns.py index f0d7e49c..826d84a5 100644 --- a/src/brasil/gov/tiles/tiles/albuns.py +++ b/src/brasil/gov/tiles/tiles/albuns.py @@ -3,11 +3,10 @@ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.app.uuid.utils import uuidToObject from plone.directives import form from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID -from Products.CMFCore.utils import getToolByName from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -66,7 +65,7 @@ def populate_with_object(self, obj): title = _(u'Gallery albums') link_url = obj.absolute_url() link_text = _(u'Access all Albums') - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) data_mgr.set({ 'title': title, @@ -92,7 +91,7 @@ def get_albuns(self): if uuid: obj = uuidToObject(uuid) if obj: - catalog = getToolByName(self.context, 'portal_catalog') + catalog = api.portal.get_tool('portal_catalog') # Procuro todas subpastas na pasta do album path = '/'.join(obj.getPhysicalPath()) @@ -113,7 +112,7 @@ def get_albuns(self): return albuns def scale(self, item): - catalog = getToolByName(self.context, 'portal_catalog') + catalog = api.portal.get_tool('portal_catalog') path = '/'.join(item.getPhysicalPath()) brains = catalog(Type=['Image', 'Folder'], path={'query': path, @@ -131,7 +130,7 @@ def scale(self, item): } def thumbnail(self, item): - catalog = getToolByName(self.context, 'portal_catalog') + catalog = api.portal.get_tool('portal_catalog') path = '/'.join(item.getPhysicalPath()) brains = catalog(Type=['Image', 'Folder'], path={'query': path, diff --git a/src/brasil/gov/tiles/tiles/audio.py b/src/brasil/gov/tiles/tiles/audio.py index 6b910358..cd0307e9 100644 --- a/src/brasil/gov/tiles/tiles/audio.py +++ b/src/brasil/gov/tiles/tiles/audio.py @@ -2,8 +2,8 @@ from brasil.gov.tiles import _ as _ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile +from plone import api from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -57,7 +57,7 @@ def populate_with_object(self, obj): else: url = obj.absolute_url() content_type = '' - uuid = IUUID(obj) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) data_mgr.set({'title': title, 'description': description, @@ -73,7 +73,7 @@ def accepted_ct(self): return ['Audio'] def get_uid(self, obj): - return IUUID(obj) + return api.content.get_uuid(obj) def init_js(self): return """ diff --git a/src/brasil/gov/tiles/tiles/audiogallery.py b/src/brasil/gov/tiles/tiles/audiogallery.py index ad048b52..961a0dbe 100644 --- a/src/brasil/gov/tiles/tiles/audiogallery.py +++ b/src/brasil/gov/tiles/tiles/audiogallery.py @@ -2,8 +2,8 @@ from brasil.gov.tiles import _ as _ from brasil.gov.tiles.tiles.list import IListTile from brasil.gov.tiles.tiles.list import ListTile +from plone import api from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -49,7 +49,7 @@ def populate_with_object(self, obj): self.set_limit() header = obj.Title() # use collection's title as header - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) old_data = data_mgr.get() @@ -63,7 +63,7 @@ def accepted_ct(self): return ['Collection', 'Folder'] def get_uid(self, obj): - return IUUID(obj) + return api.content.get_uuid(obj) def get_elements(self, obj): results = [] diff --git a/src/brasil/gov/tiles/tiles/banner_rotativo.py b/src/brasil/gov/tiles/tiles/banner_rotativo.py index 8490bebf..01ce485c 100644 --- a/src/brasil/gov/tiles/tiles/banner_rotativo.py +++ b/src/brasil/gov/tiles/tiles/banner_rotativo.py @@ -3,11 +3,11 @@ from brasil.gov.tiles.tiles.list import IListTile from brasil.gov.tiles.tiles.list import ListTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.autoform import directives as form from plone.memoize import view from plone.namedfile.field import NamedBlobImage as NamedImage from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.interface import implementer @@ -89,7 +89,7 @@ def populate_with_object(self, obj): if not self._has_image_field(obj): return self.set_limit() - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) title = obj.Title() description = obj.Description() rights = obj.Rights() diff --git a/src/brasil/gov/tiles/tiles/basic.py b/src/brasil/gov/tiles/tiles/basic.py index d53139b1..145c0942 100644 --- a/src/brasil/gov/tiles/tiles/basic.py +++ b/src/brasil/gov/tiles/tiles/basic.py @@ -5,14 +5,13 @@ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.autoform import directives as form from plone.memoize import view from plone.memoize.instance import memoizedproperty from plone.namedfile.field import NamedBlobImage as NamedImage from plone.registry.interfaces import IRegistry from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID -from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import safe_unicode from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -89,7 +88,7 @@ class BasicTile(PersistentCoverTile): @memoizedproperty def brain(self): - catalog = getToolByName(self.context, 'portal_catalog') + catalog = api.portal.get_tool('portal_catalog') uuid = self.data.get('uuid') result = catalog(UID=uuid) if uuid is not None else [] assert len(result) <= 1 @@ -129,10 +128,12 @@ def populate_with_object(self, obj): data = { 'title': safe_unicode(obj.Title()), 'description': safe_unicode(obj.Description()), - 'uuid': IUUID(obj, None), # XXX: can we get None here? see below + # XXX: can we get None here? see below + 'uuid': api.content.get_uuid(obj), 'date': True, 'subjects': True, - 'image_description': safe_unicode(obj.Description()) or safe_unicode(obj.Title()), + 'image_description': safe_unicode(obj.Description()) or + safe_unicode(obj.Title()), } # TODO: if a Dexterity object does not have the IReferenceable @@ -153,7 +154,7 @@ def accepted_ct(self): please memoize if you're doing some very expensive calculation """ registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa return settings.searchable_content_types def getAlt(self): diff --git a/src/brasil/gov/tiles/tiles/carousel.py b/src/brasil/gov/tiles/tiles/carousel.py index e6407eb2..4cdfa19a 100644 --- a/src/brasil/gov/tiles/tiles/carousel.py +++ b/src/brasil/gov/tiles/tiles/carousel.py @@ -3,9 +3,9 @@ from brasil.gov.tiles.tiles.list import IListTile from brasil.gov.tiles.tiles.list import ListTile from collective.cover.widgets.textlinessortable import TextLinesSortableFieldWidget +from plone import api from plone.autoform import directives as form from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.interface import implementer @@ -42,7 +42,7 @@ def populate_with_object(self, obj): if not self._has_image_field(obj): return self.set_limit() - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) old_data = data_mgr.get() diff --git a/src/brasil/gov/tiles/tiles/collection.py b/src/brasil/gov/tiles/tiles/collection.py index 1fc6552f..ba3ea1cd 100644 --- a/src/brasil/gov/tiles/tiles/collection.py +++ b/src/brasil/gov/tiles/tiles/collection.py @@ -4,12 +4,12 @@ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.app.uuid.utils import uuidToObject from plone.directives import form from plone.namedfile.field import NamedBlobImage as NamedImage from plone.tiles.interfaces import ITileDataManager from plone.tiles.interfaces import ITileType -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.component import queryUtility @@ -110,7 +110,7 @@ def populate_with_object(self, obj): if obj.portal_type in self.accepted_ct(): header = obj.Title() # use collection's title as header footer = _(u'More…') # XXX: can we use field's default? - uuid = IUUID(obj) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) data_mgr.set({ diff --git a/src/brasil/gov/tiles/tiles/destaque.py b/src/brasil/gov/tiles/tiles/destaque.py index a47a4af3..9b15e0f4 100644 --- a/src/brasil/gov/tiles/tiles/destaque.py +++ b/src/brasil/gov/tiles/tiles/destaque.py @@ -4,10 +4,10 @@ from collective.cover.interfaces import ICoverUIDsProvider from collective.cover.tiles.list import IListTile from collective.cover.tiles.list import ListTile +from plone import api from plone.memoize import view from plone.namedfile.field import NamedImage from plone.registry.interfaces import IRegistry -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.component import getUtility @@ -58,7 +58,7 @@ class DestaqueTile(ListTile): # XXX: are we using this function somewhere? remove? def get_uid(self, obj): - return IUUID(obj, None) + return api.content.get_uuid(obj) @view.memoize def accepted_ct(self): @@ -71,7 +71,7 @@ def accepted_ct(self): please memoize if you're doing some very expensive calculation """ registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa return settings.searchable_content_types def thumbnail(self, item): @@ -113,4 +113,4 @@ def __init__(self, context): def getUIDs(self): """ Return a list of UIDs of collection objects. """ - return [IUUID(self.context)] + return [api.content.get_uuid(self.context)] diff --git a/src/brasil/gov/tiles/tiles/header.py b/src/brasil/gov/tiles/tiles/header.py index dd19f1a7..485bfecb 100644 --- a/src/brasil/gov/tiles/tiles/header.py +++ b/src/brasil/gov/tiles/tiles/header.py @@ -2,8 +2,8 @@ from brasil.gov.tiles import _ as _ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile +from plone import api from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.interface import implementer @@ -57,7 +57,7 @@ def populate_with_object(self, obj): link_boolean = False link_text = title data_mgr = ITileDataManager(self) - uuid = IUUID(obj) + uuid = api.content.get_uuid(obj) data_mgr.set({'title': title, 'link_url': url, 'link_text': link_text, diff --git a/src/brasil/gov/tiles/tiles/list.py b/src/brasil/gov/tiles/tiles/list.py index 21c8db78..4c4da283 100644 --- a/src/brasil/gov/tiles/tiles/list.py +++ b/src/brasil/gov/tiles/tiles/list.py @@ -6,6 +6,7 @@ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.app.uuid.utils import uuidToObject from plone.directives import form from plone.memoize import view @@ -13,7 +14,6 @@ from plone.registry.interfaces import IRegistry from plone.tiles.interfaces import ITileDataManager from plone.tiles.interfaces import ITileType -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.component import getUtility @@ -151,7 +151,7 @@ def remove_item(self, uid): # XXX: are we using this function somewhere? remove? def get_uid(self, obj): - return IUUID(obj, None) + return api.content.get_uuid(obj) # XXX: refactoring the tile's schema should be a way to avoid this def get_configured_fields(self): @@ -198,7 +198,7 @@ def accepted_ct(self): please memoize if you're doing some very expensive calculation """ registry = getUtility(IRegistry) - settings = registry.forInterface(ICoverSettings) + settings = registry.forInterface(ICoverSettings) # noqa return settings.searchable_content_types def thumbnail(self, item): @@ -258,4 +258,4 @@ def __init__(self, context): def getUIDs(self): """ Return a list of UIDs of collection objects. """ - return [IUUID(self.context)] + return [api.content.get_uuid(self.context)] diff --git a/src/brasil/gov/tiles/tiles/mediacarousel.py b/src/brasil/gov/tiles/tiles/mediacarousel.py index d5d12b0d..db980dc4 100644 --- a/src/brasil/gov/tiles/tiles/mediacarousel.py +++ b/src/brasil/gov/tiles/tiles/mediacarousel.py @@ -3,10 +3,10 @@ from brasil.gov.tiles.tiles.list import IListTile from brasil.gov.tiles.tiles.list import ListTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.autoform import directives as form from plone.namedfile.field import NamedBlobImage as NamedImage from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.CMFPlone.utils import safe_hasattr from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -64,7 +64,7 @@ def populate_with_object(self, obj): self.set_limit() header = obj.Title() # use collection's title as header - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) old_data = data_mgr.get() @@ -73,7 +73,7 @@ def populate_with_object(self, obj): data_mgr.set(old_data) def get_uid(self, obj): - return IUUID(obj) + return api.content.get_uuid(obj) def thumbnail(self, item): if self._has_image_field(item): diff --git a/src/brasil/gov/tiles/tiles/poll.py b/src/brasil/gov/tiles/tiles/poll.py index 1bb009be..745831cc 100644 --- a/src/brasil/gov/tiles/tiles/poll.py +++ b/src/brasil/gov/tiles/tiles/poll.py @@ -4,9 +4,9 @@ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile from collective.polls.polls import IPolls +from plone import api from plone.app.uuid.utils import uuidToObject from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope.component import queryUtility from zope.schema import TextLine @@ -84,7 +84,7 @@ def available(self): def populate_with_object(self, obj): super(PollTile, self).populate_with_object(obj) - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) data_mgr.set({'uuid': uuid}) @@ -108,6 +108,5 @@ def has_data(self): def is_closed(self): state = 'closed' if self.poll(): - state = self.context.portal_workflow.getInfoFor(self.poll(), - 'review_state') + state = api.content.get_state(self.poll()) return state == 'closed' diff --git a/src/brasil/gov/tiles/tiles/video.py b/src/brasil/gov/tiles/tiles/video.py index 11167184..cd2456c1 100644 --- a/src/brasil/gov/tiles/tiles/video.py +++ b/src/brasil/gov/tiles/tiles/video.py @@ -2,8 +2,8 @@ from brasil.gov.tiles import _ as _ from collective.cover.tiles.base import IPersistentCoverTile from collective.cover.tiles.base import PersistentCoverTile +from plone import api from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema @@ -52,7 +52,7 @@ def populate_with_object(self, obj): title = obj.Title() url = obj.absolute_url() - uuid = IUUID(obj) + uuid = api.content.get_uuid(obj) embed = obj.embed_html data_mgr = ITileDataManager(self) data_mgr.set({'title': title, @@ -62,7 +62,7 @@ def populate_with_object(self, obj): }) def get_uid(self, obj): - return IUUID(obj) + return api.content.get_uuid(obj) def accepted_ct(self): """ Return a list of content types accepted by the tile. diff --git a/src/brasil/gov/tiles/tiles/videogallery.py b/src/brasil/gov/tiles/tiles/videogallery.py index 1a7b3263..3ad0b87f 100644 --- a/src/brasil/gov/tiles/tiles/videogallery.py +++ b/src/brasil/gov/tiles/tiles/videogallery.py @@ -3,10 +3,10 @@ from brasil.gov.tiles.tiles.list import IListTile from brasil.gov.tiles.tiles.list import ListTile from collective.cover.tiles.configuration_view import IDefaultConfigureForm +from plone import api from plone.directives import form from plone.namedfile.field import NamedBlobImage as NamedImage from plone.tiles.interfaces import ITileDataManager -from plone.uuid.interfaces import IUUID from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope import schema from zope.interface import implementer @@ -74,7 +74,7 @@ def populate_with_object(self, obj): self.set_limit() header = obj.Title() # use collection's title as header - uuid = IUUID(obj, None) + uuid = api.content.get_uuid(obj) data_mgr = ITileDataManager(self) old_data = data_mgr.get() @@ -83,7 +83,7 @@ def populate_with_object(self, obj): data_mgr.set(old_data) def get_uid(self, obj): - return IUUID(obj) + return api.content.get_uuid(obj) def thumbnail(self, item): if self._has_image_field(item):