Plone:使用敏捷生成的文件夹内容类型。如何填充文件,图像和富文本字段?

| 我使用敏捷创建了一些新的内容类型。我现在希望通过python脚本创建内容。一切都在下面的行中,并且在目标文件夹中使用正确的ID和日期生成了该项目。但是,如何将文件数据传递到文件字段,如何将图像数据传递到图像字段以及如何将richt_text数据传递到rich_text字段?
target.invokeFactory(type_name=\"content_type_name\", id=id, date=date, file=file, image=image, rich_text=rich_text)
我知道的日期;敏捷需要Python日期时间格式:
datetime.datetime(2011,1,1)
非常感谢您的帮助-我确信这里缺少一些基本知识,但尚未找到-可能是因为我在错误的位置查找。     
已邀请:
对于文件,请使用plone.namedfile.NamedFile;对于图像,请使用plone.namedfile.NamedImage;对于富文本,请使用plone.app.textfield.value.RichTextValue 例如
from plone.namedfile import NamedFile
from plone.namedfile import NamedImage
from plone.app.textfield.value import RichTextValue

file = NamedFile(\"<html></html>\", \"text/html\", u\"text.html\")
logo = ... some binary data in a byte string ...
image = NamedImage(logo, filename=\"logo.gif\")
rich_text = RichTextValue(u\"<p>A paragraph</p>\", \'text/html\', 
        \'text/x-html-safe\', \'utf-8\')
target.invokeFactory(type_name=\"content_type_name\", id=id, date=date, file=file,
        image=image, rich_text=rich_text)
    

要回复问题请先登录注册