Add a LocalizedIntegerField

This commit is contained in:
Swen Kooij
2018-06-15 12:58:01 +03:00
parent 752e17064d
commit 90597da8fd
5 changed files with 256 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import json
from typing import Union, List
from typing import Union, List, Optional
from django.conf import settings
from django.db.utils import IntegrityError
@@ -53,7 +53,7 @@ class LocalizedField(HStoreField):
setattr(model, self.name, self.descriptor_class(self))
@classmethod
def from_db_value(cls, value, *_):
def from_db_value(cls, value, *_) -> Optional[LocalizedValue]:
"""Turns the specified database value into its Python
equivalent.