The current Object

The current object holds thread-local global variables. It can be imported into any context:

from gluon import current
Objects accessible through current

Attribute

Type

Explanation

current.db

DAL

the database

current.s3db

DataModel

the model loader

current.deployment_settings

S3Config

deployment settings

current.auth

AuthS3

global authentication/authorisation service

current.gis

GIS

global GIS service

current.msg

S3Msg

global messaging service

current.xml

S3XML

global XML decoder/encoder service

current.request

Request

web2py’s global request object

current.response

Response

web2py’s global response object

current.T

TranslatorFactory

String Translator (for i18n)

current.messages

Messages

Common labels (internationalised)

current.ERROR

Messages

Common error messages (internationalised)