[Zope3-dev] Important IFile bug!

Roger Ineichen dev at projekt01.ch
Fri Jan 14 12:53:37 EST 2005


> Behalf Of Jim Fulton
> Sent: Friday, January 14, 2005 5:30 PM
> To: dev at projekt01.ch
> Cc: zope3-dev at zope.org
> Subject: Re: [Zope3-dev] Important IFile bug!
> 
> Roger Ineichen wrote:
> 
> ...
> 
> > Ok, what can I do?
> > 
> > Should I implement a IData field and enhance this field?
> 
> I think you should define an IMime schema that defines methods
> to get and set the data. I suggest that this should be a
> file-like interface, with, at least, read and write.
> It should have a mime-type attribute and an encoding
> attribute, for use with text.
> 
> Then you should define a mine field (IMImeField/MimeField)
> for data with this interface.
> 
> Finally, you need a widget.
> 
> The widget should support:
> 
> - file-upload
> 
> - text area if content type is text/* *and* if an encoding
>    is specified.
> 
> - entry of content type and, for text types, the encoding
> 
> > The validate method of this field should allowes to store 
> > String and FileChunk? Others?
> 
> The validate method should accept strings and objects
> with read methods.
> 
> > Is there a python lib for reading files and find the 
> > content type like stefan was implementing for images?
> 
> Of course, in the unlikely event that the client sends the
> file type and/or encoding with the file upload, you should
> use that information.  Otherwise, use zope.app.content_types,
> which seems to use the Python mimetypes module.
> 
> If you feel especially inspired, it would be nice to store
> file-upload data in a session if someone submits a form
> with a file-upload using other than the main submit
> button or if there are validation errors on other fields.
> IOW, it would be cool if the widget stored the data in a
> session so that the data wasn't lost on a redisplay.
> 
> Jim

Ok, I will try to add the relevant part.

I let you know if I have questions

BTW;
I allready implemented a i18n pattern in our tiks framework
perhaps it is the right time to move this back to zope3.

If I have working version, I let you know, perhaps it's 
interessting to take a look at our 18n concept and use it
instead the zope3 part.

All our file and i18n implementations work with the form 
framework out of the box.  


Regards
Roger Ineichen



More information about the Zope3-dev mailing list