While we can do this. I think you try d
rows = db().select(cacheable=True)
rows will lack update_record and delete_record methods but they should be
pickable. Let is know if that works.
On Thursday, 27 September 2012 21:26:32 UTC-5, MichaelF wrote:
>
> I want to store Rows values in a session variable. I realize I can't store
> the Rows object directly, so I use rows.to_list(). The problem is that
> where I used to be able to use attributes on the Rows object (e.g.,
> rows[0].Meet.Name), now I would have to use string keys when I access the
> list of dicts:
>
> rows = db...select()
> if rows[0].Meet.Name == ...
> session.rowsList = rows.to_list()
> ...
> rows = session.rowsList
> if rows[0]['Meet']['Name'] == ...
>
> Is there a simple way to convert the Rows object (or the result of the
> to_list() call) to a list of Storage objects?
>
> Realize that each Row (and each dict object in the to_list()) can have at
> least ("at most," maybe) two levels of dicts. The select might have
> selected from several tables. For example, a simplified result of a select
> from two joined tables (Rows.to_list(), returning two rows):
>
> [{'Person': {'City': 'Springs', 'First_name': 'Sue'},
> 'Meet': {'Start_datetime': datetime.datetime(2013, 1, 18, 18, 0)}},
> {'Person': {'City': '...}}]
>
> Yes, I can write the code; but does the code already exist...say
> Rows.to_storage()?
>
> Thanks.
>
--