def get_post_dict(post):
    """
    Return a formated dictionary of a post.

    Params:
        post -> `Post`: the post.
    
    JSON fields:
        name -> `string`: the author's name.
        message -> `string`: the message written.
        photo -> {
            uuid -> `string`: the photo's uuid.
            name -> `string`: the photo's name.
        }
    """
    if (post.photo is not None):
        photo = {
            'uuid': str(post.photo.uuid),
            'name': post.photo.name,
        }
    else:
        photo = None

    return {
        'name': post.name,
        'message': post.message,
        'photo': photo,
    }