def submission_count(sender, **kwargs): parsed_instance = kwargs.get('instance') created = kwargs.get('created') if created: stat_log.delay(GLOBAL_SUBMISSION_STATS, 1) key='%(username)s_%(xform_id_string)s_submissions'\ % {"username": parsed_instance.instance.xform.user.username, "xform_id_string": parsed_instance.instance.xform.id_string} stat_log.delay(key, 1)
def submission_count(sender, **kwargs): parsed_instance = kwargs.get('instance') created = kwargs.get('created') if created: stat_log.delay(GLOBAL_SUBMISSION_STATS, 1) key = '%(username)s_%(xform_id_string)s_submissions'\ % {"username": parsed_instance.instance.xform.user.username, "xform_id_string": parsed_instance.instance.xform.id_string} stat_log.delay(key, 1)
def test_task_stat_log(self): result = stat_log.delay("*", 1) self.assertEqual( (result.get().key, result.get().value), (u"*", 1)) self.assertTrue(result.successful())
def stats_forms_created(sender, instance, created, **kwargs): if created: stat_log.delay('formhub-forms-created', 1)
def stats_forms_created(sender, instance, created, **kwargs): if created: stathat_count('formhub-forms-created') stat_log.delay('formhub-forms-created', 1)