On Apr 11, 1:10 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
> If you are running local just print to stdout
>
> print request.vars.query.

You can also use the display of these (for debuggin) on your page -
see how welcome/views/generic.html accomplishes this.

Then there is firebug (firefox), and - if you _really_ want to get
heavy duty, you can always use wget or curl to grab the output of
pages (w/o having a browser in the way).... or simply use some "in the
middle" http packet monitor, such as wireshark (which won't work on a
localhost connection).

I'll bet between generic.html, and a good debugger on the server end,
you should be able to sort it out.

Somehow, it seems like this is too complicated - this stuff works just
simply.... so the other suggestion is to simplify, get to really,
really basic functioning before you build up what you are "really"
trying to make it look like.


>
> -Thadeus
>
> On Sun, Apr 11, 2010 at 12:32 PM, Johann Spies <johann.sp...@gmail.com> wrote:
> > Thanks Thaddeus.  I am not winning (yet)!
>
> > I have now:
>
> > def csv():
> >    import cStringIO
> >    s=cStringIO.StringIO()
> >    import gluon.conttenttype
> >    query = request.vars.query
> >    if not query:
> >        return None
> >    else:
> >        
> > db(request.vars.query).select(db.sarua.ALL,limitby=(0,250)).export_to_csv_file(s)
> >        response.headers['Content-Type'] = \
> >            gluon.contenttype.contenttype('.csv')
> >    #response.headers['Content-Type']='application/vnd.ms-excel'
> >        
> > response.headers['Content-Disposition']=attachment;filename='download.csv'
> >        return s.getvalue()
>
> > How can I debug what is going on behind the browser screen?
>
> > I want to see what the content of 'query'  is.  Is there a way to see
> > what is the result
> > --
> > "Finally, brethren, whatsoever things are true,  whatsoever things are
> > honest, whatsoever things are  just, whatsoever things are pure,
> > whatsoever things are lovely, whatsoever things are of good report; if
> > there be any virtue, and if there be any praise, think on these
> > things."    Philippians 4:8
>
> > --
> > To unsubscribe, reply using "remove me" as the subject.

Reply via email to