[Grok-dev] Re: Question about collective.namedfile package

Dirceu Pereira Tiegs dirceutiegs at gmail.com
Fri Apr 18 12:16:52 EDT 2008


Em 14/04/2008, às 04:54, Douglas Cerna escreveu:
> Dirceu:

Hi Douglas,

> I'm sorry to bother you. I've just got one question about the  
> collective.namedfile package:
>
> ### interfaces.py ###
>
> from zope.interface import Attribute
> from zope.app.file.interfaces import IFile
>
> class INamedFile(IFile):
>    filename = Attribute("Filename")
>
> class INamedImage(INamedFile):
>    pass
>
> ### interfaces.py ###
>
> If I make a create a NamedImage, it doesn't provide  
> zope.app.file.interfaces.IImage. Is that correct?

That's interesting, I didn't knew it :-). NamedImage doesn't use  
zope.app.file.image.Image as a superclass, and it doesn't implement  
getImageSize(), which is required by IImage.

> I ask, because I'm trying to use z3c.image on collective.blobfile  
> images using grok :)


Hey, that's nice! You could possibly write an adapter to adapt  
collective.namedfile.field.NamedImage and  
collective.namedblobfile.field.NamedBlobImage and make them implement  
getImageSize() and provide zope.app.file.image.IImage. I'm at FISL now  
(http://fisl.softwarelivre.org/9.0/www/), so I won't be able to work  
until next week. If you write such adapter I can integrate it with  
megrok.form.

Regards,
--
Dirceu Pereira Tiegs
Weimar Consultoria

Hospedagem Plone, Zope e Python
http://www.pytown.com




More information about the Grok-dev mailing list