Thanks for your answers, considering that web.select() returns a iterBetter
object, the only solution I see is what Tõnis proposes, but with a few
changes.

On 8/2/07, Tõnis Kevvai <[EMAIL PROTECTED]> wrote:
>
>
> web.db.query generator loses column order information.
> But, maybe if you had column names as a list?
>
> web.py
>
> class sources:
>     def GET(self):
>         columns = ['c1', 'c2', 'cn']
>         sources = web.select('sources')
>         print render.selectall(sources, columns)


the purpose of selectall() is rendering every kind of query result you pass
to it. This allows me to put a textarea and let the user enter his query
(see 'my own query' on http://kate.homeunix.net/bayesfor/website.py/).

Since we don't know what the user might enter, instead of setting
columns = ['c1', 'c2', 'cn']

I could to read select part of the query from user input, if he doesn't
enter '*' but column names and, in case of joins, he pays attention not to
specify the same column name two times, I cold print it in the same order.

Will try that and report here.
Thanks for suggestions.
Matteo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to