Ejemplo n.º 1
0
 def serialize(self):
     """Return object data for jsonification"""
     return {
         'id':
         self.id,
         'email':
         self.email,
         'roles': [r.name for r in self.roles],
         'first':
         self.first,
         'last':
         self.last,
         'minitial':
         self.minitial,
         'is_active':
         True if self.active else False,
         'is_expired':
         True if self.is_expired() else False,
         'added_at':
         utils.localize_est_date(self.added_at),
         'email_confirmed_at':
         utils.localize_est_datetime(self.email_confirmed_at),
         'access_expires_at':
         utils.localize_est_datetime(self.access_expires_at)
     }
    def serialize(self):
        """Return object data for jsonification

        Note: There is some `residual jsx code` that expects the
            `events` array to be sent
        """
        return {
            'id': self.id,
            'redcap_id': self.redcap_id,
            'events': [],
            'added_at': utils.localize_est_datetime(self.added_at),
            'last_checked_at': utils.localize_est_datetime(
                self.last_checked_at),
            'was_deleted': self.was_deleted
        }
    def serialize(self):
        """Return object data for jsonification

        Note: There is some `residual jsx code` that expects the
            `events` array to be sent
        """
        return {
            'id': self.id,
            'redcap_id': self.redcap_id,
            'events': [],
            'added_at': utils.localize_est_datetime(self.added_at),
            'last_checked_at':
            utils.localize_est_datetime(self.last_checked_at),
            'was_deleted': self.was_deleted
        }
Ejemplo n.º 4
0
 def serialize(self):
     """Return object data for jsonification"""
     return {
         'id': self.id,
         'email': self.email,
         'roles': [r.name for r in self.roles],
         'first': self.first,
         'last': self.last,
         'minitial': self.minitial,
         'is_active': True if self.active else False,
         'is_expired': True if self.is_expired() else False,
         'added_at': utils.localize_est_date(self.added_at),
         'email_confirmed_at':
             utils.localize_est_datetime(self.email_confirmed_at),
         'access_expires_at':
             utils.localize_est_datetime(self.access_expires_at)
     }
Ejemplo n.º 5
0
 def item_from_entity(entity):
     return {
         'id': entity.id,
         'user_email': entity.web_session.user.email
         if entity.web_session.user is not None else '',
         'type': entity.log_type.type,
         'details': entity.details,
         'web_session_ip': entity.web_session.ip,
         'date_time': utils.localize_est_datetime(entity.date_time),
         }
Ejemplo n.º 6
0
 def serialize(self):
     """Return object data for jsonification """
     # @TODO: add information about download counts
     return {
         'id': self.id,
         'file_name': self.file_name,
         'file_check_sum': self.file_check_sum,
         'file_size': self.file_size,
         'uploaded_at': utils.localize_est_datetime(self.uploaded_at),
         'subject_id': self.subject_id,
         'event_id': self.event_id,
         'user_id': self.user_id,
         'user_name': self.user.get_name(),
         # 'subject': self.subject.serialize(),
         # 'event': self.event.serialize(),
         # 'user': self.user.serialize(),
     }
 def serialize(self):
     """Return object data for jsonification """
     # @TODO: add information about download counts
     return {
         'id': self.id,
         'file_name': self.file_name,
         'file_check_sum': self.file_check_sum,
         'file_size': self.file_size,
         'uploaded_at': utils.localize_est_datetime(self.uploaded_at),
         'subject_id': self.subject_id,
         'event_id': self.event_id,
         'user_id': self.user_id,
         'user_name': self.user.get_name(),
         # 'subject': self.subject.serialize(),
         # 'event': self.event.serialize(),
         # 'user': self.user.serialize(),
     }
Ejemplo n.º 8
0
 def test_localize_est_datetime_none_value(self):
     self.assertEquals('', utils.localize_est_datetime(None))
Ejemplo n.º 9
0
 def test_localize_est_datetime_none_value(self):
     self.assertEquals('', utils.localize_est_datetime(None))