[python] zope - mime - ms excel

ViNiL vinil na zagamma.cz
Úterý Červenec 15 18:28:38 CEST 2003


V ?, 15. 07. 2003 v 14:45, Petr Vaněk napsal:
> 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

Aha, zkus misto "Content-type" psat "Content-Type" a napis, jak si dopad
;-)

-- 
ViNiL <vinil na zagamma.cz>
Zagamma Labs




Další informace o konferenci Python