I've posted my problem in Italian Forum and had no
answer.
I'm newbie in zope and python, and I made a form
for uploading files into Zope folders. The problem is that the name of the
folder in which uploading the file, is in a variable called "nomecartella" and
is like "Intranet.Bandi.bando18". The code I used
is:
<dtml-call
"_[nomecartella].manage_addFile(nomefile, file,
titolofile)">
where
nomecartella is the variable that contains
the path of the folder that I want contains the uploaded file;
nomefile is the id of the file I want
upload;
titolofile is the name of the
file.
But I get an error:
Error Type: KeyError
Error Value:
Intranet.Bandi.bando18
If I replace _[nomecartella]
with Intranet.Bandi.bando18 it works
!!!!
Any ideas?
Another question:
I've a set of records in a MySQL DB having a
TimeStamp field. I made a SQL method for retrieving all the records
between two dates typed in by the user ( in format %d/%m/%Y).
I used this code:
select ... from ... where ...
and "_.DateTime(time) >= <dtml-var
"ZopeTime(p_dal + _.str(' 00:00:00.000 GMT+2'))">
and
"_.DateTime(time) <= <dtml-var "ZopeTime(p_al + _.str(' 23:59:59.000
GMT+2'))">
where
time is the TimeStamp
field into the DB;
p_dal and p_al are the two
dates that make my range.
I get this error:
Error Type: ProgrammingError
Error Value: (1064, "You have an
error in your SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near '_.DateTime(time) <= 2003/07/21
23:59:59 GMT+2 LIMIT 1000' at li")
What to do?