[Plone-IT] Creazione di un nuovo oggetto con un campo immagine che non funziona :(

Vito Falco vitofalco a gmail.com
Gio 25 Giu 2009 07:02:55 UTC


No, se per FSS intendi File System Storage...

Vito

Il giorno 24 giugno 2009 22.55, Massimo Azzolini <massimo.azzolini a gmail.com
> ha scritto:

> ciao
>
> stai usando FSS?
> non ricordo il dettaglio, ma tempo fa avevamo noie con le immagini perchè
> FSS non le gestiva bene.
>
> cia'
>
> massimo
> ---
>
>
> On Wed, Jun 24, 2009 at 7:35 PM, Vito Falco <vitofalco a gmail.com> wrote:
>
>> Ciao,
>> 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 (
>> http://portale/oggetto/image) mi da un 404 (Ci dispiace ma la
>> pagina...bla)
>>
>> Questo è il py dell'oggetto. E' semplicissimo:
>>
>> """Definition of the veicolousato content type
>>> """
>>>
>>> from zope.interface import implements, directlyProvides
>>>
>>> from Products.Archetypes import atapi
>>> from Products.ATContentTypes.content import folder
>>> from Products.ATContentTypes.content import schemata
>>>
>>> from alta.special import specialMessageFactory as _
>>> from alta.special.interfaces import Iveicolousato
>>> from alta.special.config import PROJECTNAME
>>>
>>> veicolousatoSchema = folder.ATFolderSchema.copy() + atapi.Schema((
>>>
>>>     # -*- Your Archetypes field definitions here ... -*-
>>>
>>>     atapi.StringField(
>>>         'marca',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.StringWidget(
>>>             label=_(u"Marca del veicolo"),
>>>             description=_(u""),
>>>         ),
>>>         required=True,
>>>     ),
>>>     atapi.StringField(
>>>         'tipo',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.StringWidget(
>>>             label=_(u"Tipologia del veicolo"),
>>>             description=_(u""),
>>>         ),
>>>         required=True,
>>>     ),
>>>     atapi.StringField(
>>>         'dimensioni',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.StringWidget(
>>>             label=_(u"Dimensioni"),
>>>             description=_(u""),
>>>         ),
>>>         required=False,
>>>     ),
>>>     atapi.IntegerField(
>>>         'anno',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.IntegerWidget(
>>>             label=_(u"Anno di immatricolazione"),
>>>             description=_(u""),
>>>         ),
>>>         required=True,
>>>     ),
>>>     atapi.StringField(
>>>         'stato',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.StringWidget(
>>>             label=_(u"Stato d'uso"),
>>>             description=_(u""),
>>>         ),
>>>         required=False,
>>>     ),
>>>     atapi.TextField(
>>>         'descrizione',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.RichWidget(
>>>             label=_(u"Descrizione completa"),
>>>             description=_(u""),
>>>         ),
>>>         required=True,
>>>     ),
>>>     atapi.ImageField(
>>>         'image',
>>>         storage=atapi.AnnotationStorage(),
>>>         widget=atapi.ImageWidget(
>>>             label=_(u"Immagine principale"),
>>>         ),
>>>         required=False,
>>>     ),
>>> ))
>>>
>>> # Set storage on fields copied from ATFolderSchema, making sure
>>> # they work well with the python bridge properties.
>>>
>>> veicolousatoSchema['title'].storage = atapi.AnnotationStorage()
>>> veicolousatoSchema['description'].storage = atapi.AnnotationStorage()
>>>
>>> schemata.finalizeATCTSchema(
>>>     veicolousatoSchema,
>>>     folderish=True,
>>>     moveDiscussion=False
>>> )
>>>
>>> class veicolousato(folder.ATFolder):
>>>     """Scheda di un veicolo usato"""
>>>     implements(Iveicolousato)
>>>
>>>     meta_type = "veicolousato"
>>>     schema = veicolousatoSchema
>>>
>>>     title = atapi.ATFieldProperty('title')
>>>     description = atapi.ATFieldProperty('description')
>>>
>>>     # -*- Your ATSchema to Python Property Bridges Here ... -*-
>>>     marca = atapi.ATFieldProperty('marca')
>>>     marca = atapi.ATFieldProperty('tipo')
>>>     marca = atapi.ATFieldProperty('dimensioni')
>>>     marca = atapi.ATFieldProperty('anno')
>>>     marca = atapi.ATFieldProperty('stato')
>>>     marca = atapi.ATFieldProperty('descrizione')
>>>     marca = atapi.ATFieldProperty('image')
>>>
>>>
>>> atapi.registerType(veicolousato, PROJECTNAME)
>>>
>>>
>>>
>> Grazie
>> Vito
>>
>> _______________________________________________
>> Plone-IT mailing list
>> Plone-IT a lists.plone.org
>> http://lists.plone.org/mailman/listinfo/plone-it
>> http://www.nabble.com/Plone---Italy-f21728.html
>>
>
>
> _______________________________________________
> Plone-IT mailing list
> Plone-IT a lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-it
> http://www.nabble.com/Plone---Italy-f21728.html
>



-- 
"Design is the method of putting form and content together. Design, just as
art, has multiple definitions; there is no single definition. Design can be
art. Design can be aesthetics. Design is so simple, that's why it is so
complicated." by Paul Rand
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20090625/4bc8adfb/attachment.html>


Maggiori informazioni sulla lista Plone-IT