Re: "Object is of wrong type" with NamedBlogImage field

Andreas Jung <[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
Both answers are correct but the real reason was that some special code
created a BlobNamedFile instance for an BlogNamedImage field due to
copy & paste coding.

Andreas

Andreas Jung wrote:
> Plone 4.3, Dexterity 2.
> 
> I have an image field
> 
>     image = NamedBlobImage(
>        title=_(u'label_special_image'),
>        description=_(u'help_special_image'),
>        required=False,
>     )
> 
> which is updated during a migration using
> 
>                 if new_obj.portal_type == 'Image':
>                     setattr(new_obj, k, namedfile.NamedBlobImage(v,
> filename=filename))
> 
> 
> The image is stored correctly and shown correctly in our own custom
> view. When we @@edit the content-type instance and save then we
> receive an error "Object is of wrong type" (see screenshot).
> The preview of the image is also being displayed correctly.
> 
> Why is this happening?
> 
> Andreas
> 
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce.
> Perforce version control. Predictably reliable.
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> 
> _______________________________________________
> Plone-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/plone-users



------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
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.