Skip to content

Inferred Typing for models #2174

@Ifechukwu001

Description

@Ifechukwu001

Describe the bug
When using tortoise-orm from versions after 1.0.0 with static analysis tools (Pyright), field types and transaction contexts are not correctly inferred. This leads to issues with type checking during linting.

Expected behavior
Model fields should resolve to their corresponding Python types (CharField -> str, etc.).
Static analysis tools should not fall back to Any or Unknown.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions