def format(cls, user): return { 'id': user['id'], 'avatar': secure_avatar(user['avatar']['cache']), 'name': user['username'], 'hash': avatar_hash(user) }
def format(cls, post): avatar = secure_avatar(post['author']['avatar']['cache']) return { 'id': post['id'], 'avatar': avatar, 'name': post['author']['username'], 'createdAtISO': post['createdAt'].isoformat(), 'message': post['message'], 'hash': avatar_hash(post['author']) }