Hi,

Is there a proper way to use cached select outside the web2py context.
I'm using DAL in a desktop app development that do not require the full 
stack web2py framework.
The cache module seems to be bound to the global object "request" and I 
failed to figure out how to use it.

What I have tried:
     
from gluon.dal import DAL,Field
from gluon import cache

....
tables definitions etc...

...

def getObjectParent(self,aRow):
        db=self.db     
        
        #0.138999938965
        query=(db.object_object_relationship.object_B_id==aRow)\
        &(db.object_object_relationship.f_type=='parent_child')\
        &(db.object_object_relationship.object_A_id==db.Pt_object.id)       
                                    
                
        return 
db(query).select(db.Pt_object.ALL,cacheable=True,cache=(cache.CacheInRam,3600),)

--->
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File 
"C:\Users\fabrice\workspace\simplePLM\src\simplePLM\core\gluon\packages\dal\pydal\adapters\base.py",
 
line 1237, in select
    time_expire)
TypeError: __init__() takes at most 2 arguments (4 given)

Many thanks for any help,

Best regards 

Fabrice

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to