You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Visual Studio Code, there is no useful hint on the parameters and the type for the instanciation of the object.
Example:
from mongoengine import Document, StringField
class User(Document):
name = StringField(required=True)
surname = StringField(required=False)
user = User(
HINT: (...) -> User
To have useful hint, I am doing that on my project:
Example:
from typing import Optional
from mongoengine import Document, StringField
class User(Document):
name = StringField(required=True)
surname = StringField(required=False)
def __init__(self, name: str, surname: Optional[str], *args, **kwargs):
super().__init__(name=name, surname=surname, *args, **kwargs)
user = User(
HINT: (name: str, surname: str | None, ...) -> User
This is really practical but I have to do a lot of duplication of code, is there a way to propose the attributes "automatically" ? can I help you do that ?
The text was updated successfully, but these errors were encountered:
On Visual Studio Code, there is no useful hint on the parameters and the type for the instanciation of the object.
Example:
HINT: (...) -> User
To have useful hint, I am doing that on my project:
Example:
HINT: (name: str, surname: str | None, ...) -> User
This is really practical but I have to do a lot of duplication of code, is there a way to propose the attributes "automatically" ? can I help you do that ?
The text was updated successfully, but these errors were encountered: