Hi Leo, please don't post HTML to the list. Since the exception is a mysql exception, it might help to see the query you are actually attempting. I'm guessing that maybe there is some other difference between the method that works, and the one that fails, that affects the query you are generating with your ReadPhotoID ZSQL Method. You might try replacing your loop with: <dtml-var "ReadPhotoID(foname=REQUEST.get('folder'), src__=1)"> this should display the query, and possibly some clues. good luck! -steve On Friday, May 17, 2002, at 01:27 PM, Leo wrote:
Hello, I'm still working on my Zope site, and I have another problem again. I have a MySQL table called Photos and with column names: filename, foldername, PhotoID(primary key). ReadPhotoID is the ZSQL method by passing folder data and get back filename, PhotoID. photorename is the external method to pass the foldername, filename and PhotoID data, and rename the file name from "filename" to "PhotoID", eg. from "abcd.jpg" to "123.jpg". photorename code is : import os def photorename(folder, filename, photoID): os.renames("/Finish/"+folder+"/"+filename,"/Finish/"+folder+"/"+photoID+".jpg" ) So, I use the following code: <dtml-in "ReadPhotoID(foname=REQUEST.get('folder'))"> <dtml-var "photorename(REQUEST.get('folder'),filename, PhotoID)"> </dtml-in> It shows a site error with "_mysql_exceptions.NotSupportedError". However, it runs ok when I just show the data: <dtml-in "ReadPhotoID(foname=REQUEST.get('folder'))"> <dtml-var filename> <dtml-var PhotoID> </dtml-in> or put the data manually in the external method: <dtml-var "photorename(REQUEST.get('folder'), 'abcd.jpg', '123')"> Did I miss something? I worked on this problem 2 days and still cannot find out which part is wrong. Please tell me anything wrong if you found it. Thanks in advance. Leo