예제 #1
0
def datespan_from_beginning(domain_object, timezone):
    if use_new_exports(domain_object.name):
        startdate = domain_object.date_created
    else:
        startdate = get_first_form_submission_received(domain_object.name)
    now = datetime.utcnow()
    datespan = DateSpan(startdate, now, timezone=timezone)
    datespan.is_default = True
    return datespan
예제 #2
0
def datespan_from_beginning(domain_object, timezone):
    if use_new_exports(domain_object.name):
        startdate = domain_object.date_created
    else:
        startdate = get_first_form_submission_received(domain_object.name)
    now = datetime.utcnow()
    datespan = DateSpan(startdate, now, timezone=timezone)
    datespan.is_default = True
    return datespan
예제 #3
0
def datespan_from_beginning(domain_object, timezone):
    from corehq import toggles
    if toggles.NEW_EXPORTS.enabled(domain_object.name):
        startdate = domain_object.date_created
    else:
        startdate = get_first_form_submission_received(domain_object.name)
    now = datetime.utcnow()
    datespan = DateSpan(startdate, now, timezone=timezone)
    datespan.is_default = True
    return datespan
예제 #4
0
 def test_get_first_form_submission_received(self):
     self.assertEqual(get_first_form_submission_received(self.domain),
                      self.now - self._60_days)
예제 #5
0
 def test_get_first_form_submission_received(self):
     self.assertEqual(get_first_form_submission_received(self.domain), self.now - self._60_days)
예제 #6
0
def datespan_from_beginning(domain, timezone):
    now = datetime.utcnow()
    startdate = get_first_form_submission_received(domain)
    datespan = DateSpan(startdate, now, timezone=timezone)
    datespan.is_default = True
    return datespan
예제 #7
0
def first_form_submission(domain, display=True):
    try:
        submission_time = get_first_form_submission_received(domain)
    except ValueError:
        return None
    return display_time(submission_time, display) if submission_time else None
예제 #8
0
def first_form_submission(domain, display=True):
    try:
        submission_time = get_first_form_submission_received(domain)
    except ValueError:
        return None
    return display_time(submission_time, display) if submission_time else None