def time_of_last_submission(self):
        if self.last_submission_time is None and self.num_of_submissions > 0:
            try:
                last_submission = self.instances.\
                    filter(deleted_at__isnull=True).latest("date_created")
            except __HOLE__:
                pass
            else:
                self.last_submission_time = last_submission.date_created
                self.save()
        return self.last_submission_time
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/logger/models/xform.py/XForm.time_of_last_submission