hey one and all,
i'm reading chapter 10 in the book and it doesn't make sense and i don't
know how to structure my code to fit the framework. it is confusing.
so how about, if i explain what i'm trying to do and you'll tell me if i'm
crazy or direct me to a direction.
i have a form that allows the output of the table based on various custom
parameters. and i allow for the choice of the output format through a
radio input, either xml, cvs, or py. once the parameters are received from
the form, the code queries the database, processes a custom dict based on
the users customs parameters from the form, and then attempts to export
that dict as a one of the three formats and sends the stream to the
requesting user for them to have on their computer.
the main snippet looks like:
dct = {}
dct['version'] = qry[0][3]
dct['chromosome'] = qry[0][1]
dct['sequence_i'] = seqi
dct['binary_sequence'] = bseq
dct = [dct]
if (file_return == 'xml'):
response.dct = dct
return dict("hsDNA_%s_IQa.xml" % (qry[0][1]), dct)
elif (file_return == 'csv'):
response.view = 'generic.csv'
return dict(filename="hsDNA_%s_IQa.csv" % (qry[0][1]),
csvdata=dct)
else:
pass
i get a 405 error on the cvs try and i don't know how to write the code
under the xml section. i'm not ready to tackle the py section where pass
is yet.
ok, let me know, lucas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.