Skip to content

Field cannot autocompletion when its a SQLModel #890

@zhaowcheng

Description

@zhaowcheng

Privileged issue

  • I'm @tiangolo or he asked me directly to create an issue here.

Issue Content

Sorry for create this issue without permission, because this question has been in the discussion area for a week but no one has paid attention to it.

First Check

  • I added a very descriptive title here.
  • I used the GitHub search to find a similar question and didn't find it.
  • I searched the SQLModel documentation, with the integrated search.
  • I already searched in Google "How to X in SQLModel" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to SQLModel but to Pydantic.
  • I already checked if it is not related to SQLModel but to SQLAlchemy.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

from sqlmodel import SQLModel
from typing import Optional

class ModelNode(SQLModel):
    id: int
    name: str

class Node:
    id: int
    name: str

class Cluster(SQLModel):
    model_node: Optional[ModelNode] = None
    node: Optional[Node] = None

Description

Cluster.node. can autocompletion, but Cluster.model_node. cannot

Operating System

macOS

Operating System Details

IDE: vscode

SQLModel Version

0.0.16

Python Version

3.10.5

Additional Context

image

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