Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 32167d4

Browse files
committed
Reports return a to and from value
1 parent 42eddfd commit 32167d4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

atomx/models.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class Report(object):
242242

243243
def __init__(self, id, query=None, name=None, emails=None, length=None, totals=None,
244244
columns=None, created_at=None, data=None, user_id=None, session=None,
245-
is_scheduled_report=False, **kwargs):
245+
is_scheduled_report=False, to=None, from_=None, **kwargs):
246246
self.session = session
247247
self.id = id
248248
self.user_id = user_id
@@ -252,10 +252,17 @@ def __init__(self, id, query=None, name=None, emails=None, length=None, totals=N
252252
self.data = data
253253
self.length = length
254254
self.totals = totals
255+
self.to = to
256+
self.from_ = from_ or kwargs.get('from')
255257
self.columns = columns
256258
self.created_at = created_at
257259
self.is_scheduled_report = is_scheduled_report
258260

261+
if self.to:
262+
self.to = datetime.strptime(self.to, '%Y-%m-%d %H:00:00')
263+
if self.from_:
264+
self.from_ = datetime.strptime(self.from_, '%Y-%m-%d %H:00:00')
265+
259266
def __repr__(self):
260267
return "Report(created_at={}, query={})".format(self.created_at, self.query)
261268

0 commit comments

Comments
 (0)