Skip to content

Why do we need import TYPE_CHECKING in models? #406

@BEEugene

Description

@BEEugene

Hi!

This is a great template project.
Why should we import type_checking in models?
from typing import TYPE_CHECKING
https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/490c554e23343eec0736b06e59b2108fdd057fdc/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/models/item.py

As far as I understood this import is needed for linter, but how it works?
Does it somehow check database consistency?

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