Ciao,<br>ho creato un mio nuovo oggettino i tipo foldership con un campo immagine. Sicuramente sto fuso e non riesco a trovare il motivo per il quale anche se accetta il file jpg che gli passo, quando lo vado a visualizzare (<a href="http://portale/oggetto/image">http://portale/oggetto/image</a>) mi da un 404 (Ci dispiace ma la pagina...bla) <br>
<br>Questo è il py dell&#39;oggetto. E&#39; semplicissimo:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">&quot;&quot;&quot;Definition of the veicolousato content type<br>
&quot;&quot;&quot;<br><br>from zope.interface import implements, directlyProvides<br><br>from Products.Archetypes import atapi<br>from Products.ATContentTypes.content import folder<br>from Products.ATContentTypes.content import schemata<br>
<br>from alta.special import specialMessageFactory as _<br>from alta.special.interfaces import Iveicolousato<br>from alta.special.config import PROJECTNAME<br><br>veicolousatoSchema = folder.ATFolderSchema.copy() + atapi.Schema((<br>
<br>    # -*- Your Archetypes field definitions here ... -*-<br><br>    atapi.StringField(<br>        &#39;marca&#39;,<br>        storage=atapi.AnnotationStorage(),<br>        widget=atapi.StringWidget(<br>            label=_(u&quot;Marca del veicolo&quot;),<br>
            description=_(u&quot;&quot;),<br>        ),<br>        required=True,<br>    ),<br>    atapi.StringField(<br>        &#39;tipo&#39;,<br>        storage=atapi.AnnotationStorage(),<br>        widget=atapi.StringWidget(<br>
            label=_(u&quot;Tipologia del veicolo&quot;),<br>            description=_(u&quot;&quot;),<br>        ),<br>        required=True,<br>    ),<br>    atapi.StringField(<br>        &#39;dimensioni&#39;,<br>        storage=atapi.AnnotationStorage(),<br>
        widget=atapi.StringWidget(<br>            label=_(u&quot;Dimensioni&quot;),<br>            description=_(u&quot;&quot;),<br>        ),<br>        required=False,<br>    ),<br>    atapi.IntegerField(<br>        &#39;anno&#39;,<br>
        storage=atapi.AnnotationStorage(),<br>        widget=atapi.IntegerWidget(<br>            label=_(u&quot;Anno di immatricolazione&quot;),<br>            description=_(u&quot;&quot;),<br>        ),<br>        required=True,<br>
    ),<br>    atapi.StringField(<br>        &#39;stato&#39;,<br>        storage=atapi.AnnotationStorage(),<br>        widget=atapi.StringWidget(<br>            label=_(u&quot;Stato d&#39;uso&quot;),<br>            description=_(u&quot;&quot;),<br>
        ),<br>        required=False,<br>    ),<br>    atapi.TextField(<br>        &#39;descrizione&#39;,<br>        storage=atapi.AnnotationStorage(),<br>        widget=atapi.RichWidget(<br>            label=_(u&quot;Descrizione completa&quot;),<br>
            description=_(u&quot;&quot;),<br>        ),<br>        required=True,<br>    ),<br>    atapi.ImageField(<br>        &#39;image&#39;,<br>        storage=atapi.AnnotationStorage(),<br>        widget=atapi.ImageWidget(<br>
            label=_(u&quot;Immagine principale&quot;),<br>        ),<br>        required=False,<br>    ),<br>))<br><br># Set storage on fields copied from ATFolderSchema, making sure<br># they work well with the python bridge properties.<br>
<br>veicolousatoSchema[&#39;title&#39;].storage = atapi.AnnotationStorage()<br>veicolousatoSchema[&#39;description&#39;].storage = atapi.AnnotationStorage()<br><br>schemata.finalizeATCTSchema(<br>    veicolousatoSchema,<br>
    folderish=True,<br>    moveDiscussion=False<br>)<br><br>class veicolousato(folder.ATFolder):<br>    &quot;&quot;&quot;Scheda di un veicolo usato&quot;&quot;&quot;<br>    implements(Iveicolousato)<br><br>    meta_type = &quot;veicolousato&quot;<br>
    schema = veicolousatoSchema<br><br>    title = atapi.ATFieldProperty(&#39;title&#39;)<br>    description = atapi.ATFieldProperty(&#39;description&#39;)<br>    <br>    # -*- Your ATSchema to Python Property Bridges Here ... -*-<br>
    marca = atapi.ATFieldProperty(&#39;marca&#39;)<br>    marca = atapi.ATFieldProperty(&#39;tipo&#39;)<br>    marca = atapi.ATFieldProperty(&#39;dimensioni&#39;)<br>    marca = atapi.ATFieldProperty(&#39;anno&#39;)<br>    marca = atapi.ATFieldProperty(&#39;stato&#39;)<br>
    marca = atapi.ATFieldProperty(&#39;descrizione&#39;)<br>    marca = atapi.ATFieldProperty(&#39;image&#39;)<br><br><br>atapi.registerType(veicolousato, PROJECTNAME)<br><br clear="all"><br></blockquote><br>Grazie<br>Vito<br>