Hi

yet again - many thanks for this. I now realise the difference in the
queries (that [0]).

Ah well, I'm learning Web2Py slowly but surely.

I must say that I'm very impressed with the prompt response
(especially for what is probably a very basic question).

Keep up the good work

cheers

Portly

On Oct 7, 11:26 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I suggest
>
> worksheets = db(db.worksheet.id == request.args(0)).select().as_list()
> fred=worksheets[0]
>
> now both can go in a session
>
> On Oct 7, 4:25 pm, "portly.shor...@googlemail.com"
>
>
>
> <portly.shor...@googlemail.com> wrote:
> > Sure:
>
> >  worksheet = db(db.worksheet.id == request.args(0)).select()[0]
> >  fred =  worksheet.as_list()
>
> > Worksheet returns a single row - hope this helps. I'm really keen to
> > use Web2Py.
>
> > cheers
>
> > On Oct 7, 10:20 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Can you show us the code?
>
> > > On Oct 7, 3:58 pm, "portly.shor...@googlemail.com"
>
> > > <portly.shor...@googlemail.com> wrote:
> > > > Many thanks for such a quick answer. A second question (if I may). I
> > > > have a second query that returns a single row - how would I store that
> > > > in the session as trying as_list gives me an error:
>
> > > > KeyError: 'as_list'.
>
> > > > many thanks (again).
>
> > > > p.s I've bought the PDF of the second version of the book but could
> > > > not find it in there.
>
> > > > cheers
>
> > > > Portly
>
> > > > On Oct 7, 7:42 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > if
>
> > > > > rows=db().select(...)
>
> > > > > you cannot store rows in a session because it includes an open db
> > > > > connection.
> > > > > You can store
>
> > > > > rows.as_list()
>
> > > > > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> > > > > <portly.shor...@googlemail.com> wrote:
> > > > > > Hi - I am new to Web2py and think it is great but I'm stuck. Is 
> > > > > > there
> > > > > > a limit on what i can store in the Session? I want to store the the
> > > > > > results of a sql query (returning 40 records) in the session. When I
> > > > > > try I get an exception:
>
> > > > > > Traceback (most recent call last):
> > > > > >   File "gluon/main.py", line 419, in wsgibase
> > > > > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > > > > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > > > > >   File "gluon/sql.py", line 537, in __getattr__
> > > > > > KeyError: '__getstate__'
>
> > > > > > any ideas?
>
> > > > > > many thanks
>
> > > > > > Portly
--~--~---------~--~----~------------~-------~--~----~
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