The following code fails on Dexterity-based content types (plone.app.contenttypes):
with api.env.adopt_roles(['Manager']):
obj = api.content.create(
container=portal,
type='Document',
title=u'Pangram',
text=u'<p>The quick brown fox jumps over the lazy dog</p>',
)
on Archetypes, the text field is set; on Dexterity, the text field is set as a unicode object leading to the following error:
AttributeError: 'unicode' object has no attribute 'output_relative_to'
I have seen this myself. I don't know if I would class this a bug in plone.api, but it's certainly not intuitive. I personally would like this to be handled in plone.app.contenttypes, but I may be in the minority.
The following code fails on Dexterity-based content types (plone.app.contenttypes):
on Archetypes, the text field is set; on Dexterity, the text field is set as a unicode object leading to the following error:
the workaround is something like:
where do we handle this? here or in plone.app.contenttypes?