I use explicit imports combined with the use of the 'current'  object.

in the model files:

from gluon import (
current, DAL, redirect,
URL,
Field,
LABEL,
DIV,
SPAN,
HTTP,
P,
CAT,
H3,
XML,
IS_EMAIL,
IS_DATE,
IS_DATETIME,
IS_LENGTH,
IS_IN_DB,
# IS_NOT_IN_DB,
IS_NOT_EMPTY,
IS_EMPTY_OR,
IS_LOWER,
IS_EXPR,
IS_UPPER,
IS_IN_SET,
IS_INT_IN_RANGE,
IS_FLOAT_IN_RANGE,
)
from gluon.sqlhtml import SQLFORM
from gluon.storage import Storage

request = current.request
response = current.response
session = current.session
cache = current.cache
settings = current.app.settings
T = current.T
...
# after creating the db using db = DAL()
current.app.db = db
# same for the Auth() instance (and a settings object)
current.app.auth = auth


In a controller:

from gluon import (
current,
SQLFORM,
Field,
IS_IN_SET,
IS_NOT_EMPTY,
IS_INT_IN_RANGE,
IS_UPLOAD_FILENAME,
redirect,
URL,
TEXTAREA,
A,
UL,
LI,
P,
B,
SPAN,
PRE,
DIV,
INPUT,
FORM,
TABLE,
TH,
TR,
TD,
)

# from gluon.sqlhtml import SQLTABLE
from gluon.storage import Storage

db = current.app.db
request = current.request
response = current.response
session = current.session
cache = current.cache
page = current.page
scheduler = current.app.scheduler
T = current.T

Nico
On Thursday, March 5, 2026 at 1:45:02 PM UTC+1 Carlos Correia wrote:

> Hi,
>
>
> After upgrading to pycharm 2025.3 pycharm stopped recognizing global 
> objects 
> (request, auth, etc), marking them as errors.
>
> in attachment goes a screenshot illustrating the issue.
>
> Any idea on how to solve this problem?
>
>
> Thanks,
>
>
> Carlos
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/web2py/09b8ad3c-010b-4058-b951-48b8992926a6n%40googlegroups.com.

Reply via email to