Hi,
i must create newsitem with pythonscript. The source is a database.
I create object with metadata but i don't know how insert image with name lid+'jpg' located in the fs in /home/zope/images
Help!!!

The script is

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

newss= context.lettura_news_id(collocation=1)

for l in newss:
  lid = l[1].replace(' ','-')
  container.invokeFactory('News Item', id=lid)
  container[lid].edit(title=l[5], description=l[6])
  container[lid].setText(l[7])
  datina = str(l[2]).replace('/','-')+ ' '+strstr(l[3])
  container[lid].setEffectiveDate(datina)
  container[lid].setSubject("Prima")

return "Created list"


Massimiliano
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to