I agree.

On 29 out, 12:19, "mr.freeze" <nat...@freezable.com> wrote:
> I think it is worth adding an as_dict function to Rows personally.
>
> On Oct 29, 9:01 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > My bad again
>
> > item_dict=dict([(r['id'],r) for r in db(db.items.id > 0).select
> > ().as_list()])
>
> > On Oct 29, 8:58 am, Fran <francisb...@googlemail.com> wrote:
>
> > > On Oct 29, 1:52 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > oops.there should be no sterisk.
> > > > item_dict=dict([(r.id,r) for r in db(db.items.id > 0).select()])
>
> > > Great, that works ;)
>
> > > This one still fails:
> > > item_dict=dict([(r.id,r) for r in db(db.items.id > 0).select().as_list
> > > ()])
>
> > > 'dict' object has no attribute 'id'
>
> > > Of course, this is already a dict:
> > > db(db[table].id > 0).select().as_list()
>
> > > F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to