diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 110ac9a50..14b210ea2 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -85,6 +85,7 @@ from ishtar_common.utils import ( ugettext_lazy as _, ugettext, pgettext_lazy, + format_date, get_generated_id, get_current_profile, duplicate_item, @@ -770,6 +771,14 @@ class JsonDataField(models.Model): def __str__(self): return "{} - {}".format(self.content_type, self.name) + def format_value(self, value): + if value is None or value == "": + return value + if self.value_type == "D": + return format_date(value) + else: + return value + def clean(self): if not self.section: return |