From 7819165e429183bc7912e874937814c535dd7923 Mon Sep 17 00:00:00 2001 From: Aleksander Vognild Burkow Date: Mon, 4 Feb 2019 16:51:56 +0100 Subject: [PATCH] Add decimal field typings --- django-stubs/db/models/fields/__init__.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 62c594f..758c570 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional, Tuple, Iterable, Callable, Dict, Union, Type +import decimal from django.db.models import Model from django.db.models.query_utils import RegisterLookupMixin @@ -66,7 +67,7 @@ class SmallIntegerField(IntegerField): ... class BigIntegerField(IntegerField): ... class FloatField(Field): ... -class DecimalField(IntegerField): +class DecimalField(Field): def __init__( self, verbose_name: Optional[str] = ..., @@ -89,6 +90,7 @@ class DecimalField(IntegerField): validators: Iterable[_ValidatorCallable] = ..., error_messages: Optional[_ErrorMessagesToOverride] = ..., ): ... + def __get__(self, instance, owner) -> decimal.Decimal: ... class AutoField(Field): def __get__(self, instance, owner) -> int: ...