What does it mean? Is there a thread about it somewhere?

Sorry I don't understand this session thing :( I already use
cache.disk instead cache.ram...

http://groups.google.com/group/web2py/browse_frm/thread/9993d61782c9b11d/489ca6f2b2b018e0?lnk=gst&q=cache.ram+clear#489ca6f2b2b018e0

What is that I didn't count with?

Form the book:

The dictionary returned by cache_controller_on_disk is cached on disk
for 5 seconds. Remember that web2py cannot cache a dictionary that
contains unpickleable objects.

Okay, thats something... :) That was new to me. I found some hint in

http://books.google.hu/books?id=Q0s6Vgb98CQC&pg=PT333&lpg=PT333&dq=python+unpicklable&source=bl&ots=hc3169OhxB&sig=2c1QaeyARY5PAJbDASyc1h5tz-Q&hl=hu&ei=kbSKS7eKFKiImwPalvS0BA&sa=X&oi=book_result&ct=result&resnum=10&ved=0CD8Q6AEwCQ#v=onepage&q=python%20unpicklable&f=false

about unpickable objects...

There only one question:
If I change the code to

try:
  lista=db( query ).select( orderby = db.seller.name ,
cache=(cache.disk,120))
except:
  lista=db( query ).select( orderby = db.seller.name )

is the right way?

On febr. 28, 18:23, Jonathan Lundell <jlund...@pobox.com> wrote:
> On Feb 28, 2010, at 4:45 AM, mdipierro wrote:
>
> > You cannot store in a session the result of a select().
>
> This seems to come up a lot. Would it be practical to have Session catch the 
> exception and raise a more helpful (higher-level) one?
>
>
>
>
>
> > On Feb 26, 2:39 pm, szimszon <szims...@gmail.com> wrote:
> >> The table has upload field and blob to hold file. Can it cause the
> >> problem?
>
> >> On febr. 26, 21:22, szimszon <szims...@gmail.com> wrote:
>
> >>> This is the cached select which caused the trouble:
>
> >>> SELECT invoice.id, invoice.seller_id, invoice.number, invoice.date,
> >>> invoice.document, invoice.invoicedata, seller.id, seller.name,
> >>> seller.address, seller.email, seller.phone, seller.description FROM
> >>> invoice, seller WHERE ((invoice.id>0 AND invoice.seller_id=seller.id)
> >>> AND invoice.id=370) ORDER BY seller.name;
>
> >>> On febr. 26, 16:22, szimszon <szims...@gmail.com> wrote:
>
> >>>> Error traceback
>
> >>>> Traceback (most recent call last):
> >>>>   File "gluon/restricted.py", line 173, in restricted
> >>>>     exec ccode in environment
> >>>>   File "applications/raktar/compiled/controllers_lista_szamla.py",
> >>>> line 360, in <module>
> >>>>   File "gluon/globals.py", line 96, in <lambda>
> >>>>     self._caller = lambda f: f()
> >>>>   File "gluon/tools.py", line 1850, in f
> >>>>     return action(*a, **b)
> >>>>   File "applications/raktar/compiled/controllers_lista_szamla.py",
> >>>> line 74, in szamla
> >>>>   File "gluon/sql.py", line 3048, in select
> >>>>     rows = cache_model(key, lambda : response(query), time_expire)
> >>>>   File "gluon/cache.py", line 305, in __call__
> >>>>     storage[key] = (time.time(), value)
> >>>>   File "/usr/lib/python2.5/shelve.py", line 123, in __setitem__
> >>>>     p.dump(value)
> >>>>   File "/usr/lib/python2.5/copy_reg.py", line 69, in _reduce_ex
> >>>>     raise TypeError, "can't pickle %s objects" % base.__name__
> >>>> TypeError: can't pickle buffer objects
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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