(choices)
return new_choices
Map choices for post types to a more informative description.
Map choices for post types to a more informative description.
Map choices for post types to a more informative description .
def informative_choices(choices):
    """
    Map choices for post types to a more informative description.
    """
    mapper = {
        Post.QUESTION: "Ask a question", Post.TUTORIAL: "Share a Tutorial",
        Post.JOB: "Post a Job Opening", Post.FORUM: "Start a Discussion",
        Post.TOOL: "Share a Tool", Post.NEWS: "Announce News"
    }
    new_choices = []
    for c in choices:
        new_choices.append((c[0], mapper.get(c[0], c[1])))

    return new_choices
def informative_choices ( choices ) : mapper = { Post . QUESTION : "Ask a question" , Post . TUTORIAL : "Share a Tutorial" , Post . JOB : "Post a Job Opening" , Post . FORUM : "Start a Discussion" , Post . TOOL : "Share a Tool" , Post . NEWS : "Announce News" } new_choices = [ ] for c in choices : new_choices . append ( ( c [ 0 ] , mapper . get ( c [ 0 ] , c [ 1 ] ) ) ) return new_choices