I think Bruno's method will create a Rows object, but it might be missing 
some metadata about the db and fields that are required by SQLTABLE.

Anthony

On Friday, November 18, 2011 3:31:07 PM UTC-5, David Watson wrote:
>
> Hi Bruno, 
>
> I tried both of these but neither one worked. I just wound up with an 
> empty table. I wasn't sure why you used Row objects in one list 
> comprehension and Storage objects in the other, but neither one 
> produced a list that the table likes. :( Not sure what's going on 
> there but there were no exceptions thrown and I know the raw rows list 
> is properly populated prior to the conversion to Rows. 
>
> Thanks, 
> David 
>
> On Nov 16, 8:09 pm, Bruno Rocha <[email protected]> wrote: 
> > wait, there is a better way. 
> > 
> > >>> from gluon.dal import Rows, Row 
> > >>> result = access.db.executesql("SELECT first_name, last_name FROM 
> > 
> > auth_user", as_dict=True)>>> rows = Rows(records=[Row(item) for item in 
> result]) 
> > >>> rows[0].first_name 
> > 
> > u'Bruno' 
> > 
> > You can set other values for each Row.

Reply via email to