Hello-
I want to re-use some data access routines in a few different
controller files, so I would like to put them in a separate file in
the /modules directory, and then import that file into the controller
files that need them. However, I'm running into this error because I'm
trying to use some web2py stuff in my module, like caching - and this
is a conditional import that depends on accessing the request
variable.

in /modules/my_module.py:
if request.env.web2py_runtime_gae: # if running on Google App Engine
    from gluon.contrib.gae_memcache import MemcacheClient
    cache.ram=cache.disk=MemcacheClient(request)

error:
name 'request' is not defined

Another way to put it is that I'm building an abstraction layer on top
of web2py's DAL so that I can reuse my code. Is this possible? Or
maybe a bad idea?

Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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