then how to put s=StringIO.StringIO() records.export_to_csv_file(s) response.headers['Content-Type']='text/csv' return s.getvalue()
into records=db(db.dog.owner==request.vars.owner)\ .select(orderby=db.dog.title) form=SQLFORM(db.entry,fields=['owner']) On Feb 5, 1:16 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > http://www.hanselman.com/blog/TheContentDispositionSagaControllingThe... > > in web2py-ese > > response.headers['Content-Dispotion']='filename=%s' % filename > > On Feb 4, 9:50 pm, INeedHelp <zhang.kil...@gmail.com> wrote: > > > > > I have this fucntion which will drop down list all owner name and a > > submit button. after i click on e submit button, e screen will display > > all dogs below to e selected owner (from dropdownlist) > > > def index(): > > > records=db(db.dog.owner==request.vars.owner)\ > > .select(orderby=db.dog.title) > > form=SQLFORM(db.entry,fields=['owner']) > > > but now, i would like to add in this function (below) after click the > > submit button, it will save "only" e selected owner and his all dogs. > > and how can i set the name of the file to be saved according to the > > owner name plus the datetime > > > s=StringIO.StringIO() > > records.export_to_csv_file(s) > > response.headers['Content-Type']='text/csv' > > return s.getvalue() > > > thanks in advance- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---