def make_article_json(a):
    """Make an Article object into a dictionary."""
    j = {
        'snippet': a.snippet,
        'aid': a.aid
    }
    if a.subsection_name:
        j['subsection_name'] = a.subsection_name
    if a.imgurl:
        j['imgurl'] = a.imgurl
    return j