[python] zope - mime - ms excel

Petr Vaněk petr.vanek na ika.cz
Úterý Červenec 15 14:45:10 CEST 2003


stale kvoka. muj python:
import string

#container.REQUEST.RESPONSE.setHeader('Content-type', 'text/x-cvs')
#container.REQUEST.RESPONSE.setHeader('Content-type', 
'application/vnd.ms-excel')
container.REQUEST.RESPONSE.setHeader('Content-type', 
'text/semicolon-seperated-values')
container.REQUEST.RESPONSE.setHeader('Expires',  'Mon, 26 Jul 1997 05:00:00 
GMT') # Date in the past
container.REQUEST.RESPONSE.setHeader('Cache-Control', 'no-store, no-cache, 
must-revalidate') # HTTP/1.1
container.REQUEST.RESPONSE.setHeader('Cache-Control', 'post-check=0, 
pre-check=0')
container.REQUEST.RESPONSE.setHeader('Pragma', 'no-cache') # HTTP/1.0 
print "user id;Real name;Assignment;Odevzdano;Hodnoceni"
for i in context.DBQ_assignment_predmet(assignment=formdictionary["predmet"]):
   rname = str(i["realname"])
   rname = string.replace(rname, "  ", " ")
   rname = string.rstrip(rname)
   print 
str(i["user_id"])+';'+rname+';'+str(i["predmet"])+';'+str(i["odevzdano1"])+';'+str(i["hodnoceni1"])

return printed


divne je, ze stahovany soubor nezobrazi zadny mime typ
-- 
Petr Vanek --------------
petr.vanek [at] ika [dot] cz
www.yarpen.cz ----------------
Kuolema Kaikille (Paitsi Meille)

Today is good day to end it all




Další informace o konferenci Python