Skip to content

Add missing methods to Field. #100

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

Closed
wants to merge 1 commit into from
Closed

Add missing methods to Field. #100

wants to merge 1 commit into from

Conversation

@mkurnikov mkurnikov closed this Jul 7, 2019
@mkurnikov mkurnikov reopened this Jul 7, 2019
Copy link
Member

@mkurnikov mkurnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!

@@ -69,6 +69,10 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
def formfield(self, **kwargs) -> FormField: ...
def contribute_to_class(self, cls: Type[Model], name: str, private_only: bool = ...) -> None: ...
def to_python(self, value: Any) -> Any: ...
def get_attname(self) -> str: ...
def value_from_object(self, obj) -> _GT: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you extract this line (whuch causes test failures) in a different PR? It's probably not obvious of a change, and requires a test.

@@ -69,6 +69,10 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
def formfield(self, **kwargs) -> FormField: ...
def contribute_to_class(self, cls: Type[Model], name: str, private_only: bool = ...) -> None: ...
def to_python(self, value: Any) -> Any: ...
def get_attname(self) -> str: ...
def value_from_object(self, obj) -> _GT: ...
def validate(self, value, model_instance) -> None: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add annotations to the function arguments?

def get_attname(self) -> str: ...
def value_from_object(self, obj) -> _GT: ...
def validate(self, value, model_instance) -> None: ...
def run_validators(self, value) -> None: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, annotations for arguments

@mkurnikov
Copy link
Member

I addressed those in #109

@mkurnikov mkurnikov closed this Jul 21, 2019
voidus pushed a commit to voidus/django-stubs that referenced this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants