Tamas,
I'm more confused now -- would I do this in my controller or in the
mako file? If, in my controller, dont I need to create an array for
each field, that is:
i = 0
for row in c.result
c.current_disposition_code[i] = row['current_disposition_code']
c.num[i] = row['num']
i = i + 1
I dont see how I can move, say, c.current_disposition_code and c.num
to the make output? I don't seem to be getting any output still (I'm
still missing something):
% for result in c.current_disposition_code:
${result}
% endfor
Thanks for your help and insight with this. RVince
On Aug 2, 9:26 am, Tamás Bajusz <[email protected]> wrote:
> On Tue, Aug 2, 2011 at 3:07 PM, RVince <[email protected]> wrote:
> > In my controller class, I perform a rather basic, straightforward SQL
> > query:
>
> > connection = engine.connect()
> > trans = connection.begin()
> > try:
> > c.result = connection.execute("select
> > current_disposition_code,count(*) as num from cms_input_file group by
> > current_disposition_code;")
> > connection.close()
>
> > thus my c.result is an sqlalchemy.engine.base.ResultProxy object.
>
> > When I go to render this in a mako file as:
>
> > % for result in c.results:
> > ${result.current_disposition_code}[${result.num}]
> > % endfor
>
> > I get no output. I am quite certain this is becuase I am using a
> > ResultProxy object. How can I output such an object inthe mako files,
> > or alternatively, how might i convert a ResultProxy objectsuch that I
> > can output it in a mako file? Thanks! RVince
>
> Seems you missed fetching some rows from
> ResultProxy.http://www.sqlalchemy.org/docs/core/connections.html#sqlalchemy.engin...
>
> Hope this helps.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en.