Is your feature request related to a problem? Please describe.
In a root validator, values need to be accessed with ["field"]
and thus, PyCharm does not know the type of the fields.
Describe the solution you'd like
I'd like the plugin to provide the types (which are declared in the model) to PyCharm, like in this example:
import pydantic
from datetime import datetime
class M(pydantic.BaseModel):
d: datetime
@pydantic.root_validator
def _(cls, values):
d = values["d"]
return values
Put the cursor on d
in the validator and call View -> Type Info. It should display datetime
.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too