<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>A me funziona qualcosa del tipo</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>description = request.form['descrizione']</DIV>
<DIV>file = request.form.get('allegato', None)</DIV>
<DIV>if not file:</DIV>
<DIV> ...</DIV>
<DIV>filename = file.filename</DIV>
<DIV>id = ...</DIV>
<DIV>
<DIV>title = ...</DIV>miofolder.invokeFactory("File", id=id, title=title,
description=description, file=file)</DIV>
<DIV><FONT size=2 face=Arial>fileobject = getattr(miofolder,
id)<BR>fileobject.reindexObject()</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Ciao, Giovanni</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=fabrizio.rota@gmail.com
href="mailto:fabrizio.rota@gmail.com">Fabrizio Rota</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=plone-it@lists.plone.org
href="mailto:plone-it@lists.plone.org">La lista degli italiani appassionati di
Plone.</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 04, 2009 7:41
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Plone-IT] il nome giusto dei
campi</DIV>
<DIV><BR></DIV>
<DIV>PREMESSA</DIV>Usando Ploneformgen riesco a creare documenti in modo
"guidato", ovvero attraverso un form.
<DIV>Con</DIV>
<DIV>invokeFactory("News Item", id=uid, title=form['titolo'])</DIV>
<DIV>creo una news con un certo titolo</DIV>
<DIV><BR></DIV>
<DIV>con</DIV>
<DIV>setDescription(form['descrizione'])</DIV>
<DIV>associo al documento la descrizione</DIV>
<DIV><BR></DIV>
<DIV>E ORA LA DOMANDA....</DIV>
<DIV>Vorrei fare la stessa cosa per creare degli oggetti "File":</DIV>
<DIV><BR></DIV>
<DIV>con</DIV>
<DIV>invokeFactory("File", id=uid, title=form['titolo'])</DIV>
<DIV>genero il file, e funge</DIV>
<DIV><BR></DIV>
<DIV>con</DIV>
<DIV>setDescription(form['descrizione'])<BR clear=all>metto la descrizione, e
funge</DIV>
<DIV><BR></DIV>
<DIV>ma.... come faccio ad associare all'oggetto "file" il file fisico che ho
scelto nel form di Ploneformgen?</DIV>
<DIV>serve qualcosa tipo</DIV>
<DIV>setFile(form['allegato']]</DIV>
<DIV><BR></DIV>
<DIV>ma setFile da errore e non trovo il nome giusto per il campo.</DIV>
<DIV><BR></DIV>
<DIV>Potete aiutarmi?<BR>-- <BR>Faber<BR>--------------------<BR>"Life is what
happens to you while you're busy making other plans" - J. Lennon<BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Plone-IT mailing
list<BR>Plone-IT@lists.plone.org<BR>http://lists.plone.org/mailman/listinfo/plone-it<BR>http://www.nabble.com/Plone---Italy-f21728.html</BLOCKQUOTE></BODY></HTML>