Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved attribute reference 'objects' #1288

Open
saltysteev opened this issue Apr 8, 2024 · 0 comments
Open

Unresolved attribute reference 'objects' #1288

saltysteev opened this issue Apr 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@saltysteev
Copy link

saltysteev commented Apr 8, 2024

Describe the bug
Not sure if this exists with other IDEs but in PyCharm after migrating codebase to 0.20.0, all of my database queries are getting a warning "Unresolved attribute reference 'objects' for class"

The program works, but the warnings stop me from seeing any code completion or documentation in the editor.

For example:
count = await Player.objects.count()
PyCharm is unhappy: Unresolved attribute reference 'objects' for class 'Player'

To Reproduce
Steps to reproduce the behavior:
db.py

base_ormar_config = ormar.OrmarConfig(
    database=databases.Database(DATABASE_URL),
    metadata=sqlalchemy.MetaData(),
    engine=sqlalchemy.create_engine(DATABASE_URL),
)

class Player(ormar.Model):
    ormar_config = base_ormar_config.copy()
    uid: int = ormar.BigInteger(primary_key=True)

count.py
pcount = await Player.objects.count()

Expected behavior
No warnings

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Database backend: SQLITE
  • Python version: 3.12
  • ormar version: 0.20.0
  • pydantic version: 2.7.0b1
@saltysteev saltysteev added the bug Something isn't working label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant