I'm trying to copy the content in news items to other content type that I wrote. In my script I have the news
item and the project
item. The second, project
, is a content type defined using Dexterity. It would be wonderful if I could to copy the image and the body text from news
to project
in the next way.
project.text = news.text
project.image = news.image
Where text and image are defined in the project
schema as RichText and NamedBlobImage. I don't know how the attributes are in the news item. I only know that I can get the image in the news item using the method getImage()
but assign it to the project generates an error when rendering the project.
So I need some pointers to solve my basic questions:
How can I know the attribute names for Archetype content types. For example, in this case I need to know the name of the attribute for the body text of news item.
How can I convert an image attached to a news item to an image attached to a dexterity content type.