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'oggetto. E' 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">"""Definition of the veicolousato content type<br>
"""<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> 'marca',<br> storage=atapi.AnnotationStorage(),<br> widget=atapi.StringWidget(<br> label=_(u"Marca del veicolo"),<br>
description=_(u""),<br> ),<br> required=True,<br> ),<br> atapi.StringField(<br> 'tipo',<br> storage=atapi.AnnotationStorage(),<br> widget=atapi.StringWidget(<br>
label=_(u"Tipologia del veicolo"),<br> description=_(u""),<br> ),<br> required=True,<br> ),<br> atapi.StringField(<br> 'dimensioni',<br> storage=atapi.AnnotationStorage(),<br>
widget=atapi.StringWidget(<br> label=_(u"Dimensioni"),<br> description=_(u""),<br> ),<br> required=False,<br> ),<br> atapi.IntegerField(<br> 'anno',<br>
storage=atapi.AnnotationStorage(),<br> widget=atapi.IntegerWidget(<br> label=_(u"Anno di immatricolazione"),<br> description=_(u""),<br> ),<br> required=True,<br>
),<br> atapi.StringField(<br> 'stato',<br> storage=atapi.AnnotationStorage(),<br> widget=atapi.StringWidget(<br> label=_(u"Stato d'uso"),<br> description=_(u""),<br>
),<br> required=False,<br> ),<br> atapi.TextField(<br> 'descrizione',<br> storage=atapi.AnnotationStorage(),<br> widget=atapi.RichWidget(<br> label=_(u"Descrizione completa"),<br>
description=_(u""),<br> ),<br> required=True,<br> ),<br> atapi.ImageField(<br> 'image',<br> storage=atapi.AnnotationStorage(),<br> widget=atapi.ImageWidget(<br>
label=_(u"Immagine principale"),<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['title'].storage = atapi.AnnotationStorage()<br>veicolousatoSchema['description'].storage = atapi.AnnotationStorage()<br><br>schemata.finalizeATCTSchema(<br> veicolousatoSchema,<br>
folderish=True,<br> moveDiscussion=False<br>)<br><br>class veicolousato(folder.ATFolder):<br> """Scheda di un veicolo usato"""<br> implements(Iveicolousato)<br><br> meta_type = "veicolousato"<br>
schema = veicolousatoSchema<br><br> title = atapi.ATFieldProperty('title')<br> description = atapi.ATFieldProperty('description')<br> <br> # -*- Your ATSchema to Python Property Bridges Here ... -*-<br>
marca = atapi.ATFieldProperty('marca')<br> marca = atapi.ATFieldProperty('tipo')<br> marca = atapi.ATFieldProperty('dimensioni')<br> marca = atapi.ATFieldProperty('anno')<br> marca = atapi.ATFieldProperty('stato')<br>
marca = atapi.ATFieldProperty('descrizione')<br> marca = atapi.ATFieldProperty('image')<br><br><br>atapi.registerType(veicolousato, PROJECTNAME)<br><br clear="all"><br></blockquote><br>Grazie<br>Vito<br>