From 9460726acb1b9d93011b2964fc7c768cef963f65 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 13 Oct 2021 15:25:12 +0200 Subject: [PATCH] misc: add grouping of data by day (#57825) --- bijoe/engine.py | 2 -- bijoe/schemas.py | 2 ++ bijoe/visualization/forms.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bijoe/engine.py b/bijoe/engine.py index 0cbec26..96a8082 100644 --- a/bijoe/engine.py +++ b/bijoe/engine.py @@ -139,8 +139,6 @@ class EngineDimension: return hashlib.md5(force_bytes(key)).hexdigest() def members(self, filters=()): - assert self.type != 'date' - if self.type == 'bool': return [Member(id=True, label=_('Yes')), Member(id=False, label=_('No'))] diff --git a/bijoe/schemas.py b/bijoe/schemas.py index 12957ae..8911a45 100644 --- a/bijoe/schemas.py +++ b/bijoe/schemas.py @@ -202,6 +202,8 @@ class Dimension(Base): self.absent_label = _('N/A') else: raise NotImplementedError('not absent label for type %r' % self.type) + if self.type == 'date' and not self.value_label: + self.value_label = 'TO_CHAR(%s, \'DD/MM/YYYY\')' % self.value @property def dimensions(self): diff --git a/bijoe/visualization/forms.py b/bijoe/visualization/forms.py index 50aa845..05bde09 100644 --- a/bijoe/visualization/forms.py +++ b/bijoe/visualization/forms.py @@ -172,7 +172,7 @@ class CubeForm(forms.Form): dimension_choices = [('', '')] + [ (dimension.name, dimension.label) for dimension in cube.dimensions - if dimension.type not in ('datetime', 'date') + if dimension.type not in ('datetime',) ] # loop self.base_fields['loop'] = forms.ChoiceField( -- 2.33.0