Re: Zwei ArrayField Fragen: Feldzugriff und Fehler bei ImageField

Nico Grubert <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
> 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)

Ich antworte mal selbst, da ich zwar weiss, wie ich den Fehler umgehe, 
aber die eigentliche Ursache habe ich nicht herausgefunden.

In Products.Archetypes.BaseObject.py Zeile 318 steht in getContentType() 
folgender Code:

if field and shasattr(field, 'getContentType'):
     return field.getContentType(self)

Wenn ich aus dieser Zeile

   try: return field.getContentType(self)
   except: return field.getContentType()

mache, klappt alles wunderbar. Ich weiss leider nicht, ob das ein Bug 
ist, oder ob ich etwas übersehen habe.

Gruss
Nico



_______________________________________________
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.