-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Is it normal unable to use autocomplete for SQLModel class field? #483
Comments
@ggree1 need pydantic plugins. |
already installed and no problem with pydantic model. Anyway it looks my IDE problem.. thanks. |
It's probably that PyCharm still doesn't support dataclass_transform, that's a new standard in Python and it was adopted by Pydantic and SQLModel even before it was an official standard. You can probably ask them to add support for it. 🤓 |
@tiangolo I will report this to JetBrains |
@linpan Thanks for the clarification. Actually I'm a Java developer so I was using latest IntelliJ with python plugin which supports almost same as Pycharm. I guess the python plugin has not yet updated this funcionality. |
Just a note, autocompletion for attributes would work even without support for dataclass_transform. What dataclass_transform would help with is autocompletion for parameters when creating a new instance of the class. |
Was there a solution to this issue? I am using Pycharm 2024.1.1 and still running into this issue :( @linpan it seems to be working for you..? My user model is as follows class UserModel(UserBase, table=True):
__tablename__ = "_user"
id: int | None = Field(default=None, primary_key=True) With the others looking much the same Here is what Pycharm looks like EDIT: to possibly answer my own question, it looks like this may be related to this PyCharm issue https://youtrack.jetbrains.com/issue/PY-54560/Support-PEP-681-typing.dataclasstransform is that correct? |
still have. SQLAlchemy have not autocompletion ,when instance. |
@HeiziND i opened an issue on JetBrains here If it is with the plugin, I will possibly look into raising it there. The weird thing is that autocomplete works perfectly when the interpreter is removed from the project. See the above issue for an example of that. |
I have the same issue. |
First Check
Commit to Help
Example Code
Description
I'm using Pycharm.
When I write code like,
select(Hero1).where(Hero1.age > 35)
I expect IDE to show field 'age' when I type 'Hero1.' but IDE autocomplete displays no fields of Hero1.
but with Hero2 (without SQLModel inherits), it surely works fine.
Is this normal or only my IDE problem?
Operating System
Windows
Operating System Details
windows 10
Pycharm 2022
SQLModel Version
0.0.8
Python Version
3.10.6
Additional Context
The text was updated successfully, but these errors were encountered: