On Dec 7, 2007 7:23 PM, Petr Jakeš <[EMAIL PROTECTED]> wrote:
> Hi,
> I have found following code does create file "myFile.zip" which contains 2
> csv files (hisSelect.csv, salSelect.csv), but the .zip file size is
> approximately same as the size of hisSelect.csv + salSelect.csv   files. I
> mean no real compression is done.

Python's zipfile.ZipFile class defaults to using compression =
ZIP_STORED (i.e. no compression). The other option, ZIP_DEFLATE,
requires that zlib is installed. If you want to set the compression on
the zip file, you need to create it beforehand and then pass it in to
export_csv_zip using the zip option:

hisSelect = SalaryHistory.select()
salSelect = Sales.select()
myZip = zipfile.ZipFile("C:/myFile.zip, mode='w', compression=compression)
export_csv_zip([hisSelect, salSelect], zip=myZip)

[This code is untested. :]

Schiavo
Simon
-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to