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