Skip to content

Commit 1512505

Browse files
authored
Merge pull request #60 from AdrianMuntean/error_on_empty_localized_integer_field
Return empty string in case the LocalizedIntegerField is null
2 parents eb2cb6b + d8b8727 commit 1512505

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Besides ``LocalizedField``, there's also:
279279

280280
Allows storing integers in multiple languages. This works exactly like ``LocalizedField`` except that
281281
all values must be integers. Do note that values are stored as strings in your database because
282-
the backing field type is ``hstore``, which only allows storing integers. The ``LocalizedIntegerField``
282+
the backing field type is ``hstore``, which only allows storing strings. The ``LocalizedIntegerField``
283283
takes care of ensuring that all values are integers and converts the stored strings back to integers
284284
when retrieving them from the database. Do not expect to be able to do queries such as:
285285

localized_fields/value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,4 @@ def __str__(self) -> str:
233233
"""Returns string representation of value"""
234234

235235
value = self.translate()
236-
return str(value) if value is not None else None
236+
return str(value) if value is not None else ''

0 commit comments

Comments
 (0)