Re: Zwei ArrayField Fragen: Feldzugriff und Fehler bei ImageField

Nico Grubert <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
>> ArrayField(
>>    CompoundField(name='bilder', schema=atapi.Schema((
>>       atapi.ImageField(name='bild',
>>         label=u'Bild', 
>>
>>         searchable = 0,
>>         required = 0,
>>         max_size = (380, 220),
>>         allowable_content_types = ('image/gif','image/jpeg','image/png'),
>>         widget = atapi.ImageWidget(label = u'Bild'),
>>         ),
>>       atapi.StringField(name='bildunterschrift',
>>         accessor="getBildunterschrift",
>>         label = u'Bildunterschrift'),
>>       atapi.StringField(name='textblock',
>>         accessor="getTextblock",
>>         label = u'Textblock'),
>>     ),),
>>     ),
>>     widget=EnhancedArrayWidget(
>>        label=u"Bilder, Bildunterschriften und Text", 
>>
>>     ),
>>     size=2,
>> ),

Jens, du hattest mal geschrieben, dass ArrayFields nicht mit Reference 
Feldern funktionieren.
Funktionieren sie mit TextArea Feldern, die ein RichWidget benutzen? Ich 
habe nämlich mal versucht, mein 'StringField'

   atapi.StringField(name='textblock',
      accessor="getTextblock",
      label = u'Textblock'),

in

    atapi.TextField(name='textblock',
                    accessor="getTextblock",
                    label = u'Textblock',
                    widget = atapi.RichWidget(rows = 3, cols = 40,),)

umzuwandeln.
Leider erhalte beim Speichern den folgenden Fehler:
-------------------------------------------------------------------------<
Exception Type  	TypeError
Exception Value 	getContentType() takes exactly 1 argument (2 given)

Traceback (innermost last):

     * Module ZPublisher.Publish, line 119, in publish
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 42, in call_object
     * Module Products.CMFPlone.FactoryTool, line 376, in __call__
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 42, in call_object
     * Module Products.CMFFormController.FSControllerPageTemplate, line 
90, in __call__
     * Module Products.CMFFormController.BaseControllerPageTemplate, 
line 28, in _call
     * Module Products.CMFFormController.ControllerBase, line 231, in 
getNext
     * Module Products.CMFFormController.Actions.TraverseTo, line 38, in 
__call__
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 42, in call_object
     * Module Products.CMFFormController.FSControllerPythonScript, line 
106, in __call__
     * Module Products.CMFFormController.ControllerBase, line 231, in 
getNext
     * Module Products.CMFFormController.Actions.TraverseTo, line 38, in 
__call__
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 42, in call_object
     * Module Products.CMFFormController.FSControllerPythonScript, line 
104, in __call__
     * Module Products.CMFFormController.Script, line 145, in __call__
     * Module Products.CMFCore.FSPythonScript, line 140, in __call__
     * Module Shared.DC.Scripts.Bindings, line 313, in __call__
     * Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
     * Module Products.CMFCore.FSPythonScript, line 196, in _exec
     * Module None, line 6, in validate_integrity
       <FSControllerPythonScript at /plone/validate_integrity used for 
/plone/erew>
       Line 6
     * Module Products.Archetypes.BaseObject, line 510, in validate
     * Module Products.Archetypes.Schema, line 586, in validate
     * Module Products.CompoundField.EnhancedArrayWidget, line 72, in 
process_form
     * Module Products.CompoundField.CompoundWidget, line 64, in 
process_form
     * Module Products.Archetypes.Widget, line 613, in process_form
     * Module Products.Archetypes.BaseObject, line 266, in isBinary
     * Module Products.Archetypes.BaseObject, line 318, in getContentType

TypeError: getContentType() takes exactly 1 argument (2 given)
-------------------------------------------------------------------------<



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.