Nidelven IT - All about Python, Zope & Plone - and Open Source!

Here you'll find issues related to our services. Mostly about Python, Zope and Plone, as well as hosting-related issues.

"Keeping IT real"

Older entries

Atom - Subscribe - Categories
Previous | Next

Products.BlobNewsItem - strange issues and new release

I was working on Products.BlobNewsItem before the weekend as I was bumping into strange issues that made the image blob field not display on editing and viewing of the newsitem content type.

After some back and forth, looking around I found a pretty decent solution to the issue.. after putting some print statements in Archetypes I found that the field wasn't writeable, and looking further down, the accessor and mutator properties and methods weren't being set for the ImageField.

Well, I put this code in there:

class MyBlob:
\tsecurity = ClassSecurityInfo()

\tsecurity.declareProtected(ModifyPortalContent, 'setImage')
\tdef setImage(self, *arguments, **keywords):
\t\tfield = self.getField('image')
\t\tfield.set(self, *arguments, **keywords)

\tsecurity.declareProtected(ModifyPortalContent, 'getImage')
\tdef getImage(self, *arguments, **keywords):
\t\tfield = self.getField('image')
\t\treturn field.get(self, *arguments, **keywords) =
newsitem.ATNewsItem.setImage = MyBlob.setImage.im_func
newsitem.ATNewsItem.getImage = MyBlob.getImage.im_func


as well as


in the ImageField and that does the trick. Why this issue popped up I don't know, but at least there's a pretty easy way to fix it.

[Permalink] [By morphex] [Python, Zope, Plone - and anything loosely related to that (Atom feed)] [2012 04 Jun 08:18 GMT+2]

Add comment (text format)


A passphrase is required to comment on this weblog. It is required to make sure that bots aren't doing automatic spamming. It is: nit is the best!.