def get_vote_summary(vote, request, url=None):
    """ Returns some basic informations about the given vote as a JSON
    seriazable dict. """
    try:
        divider = vote.ballots.count() or 1
    except AttributeError:
        divider = 1
    last_modified = vote.last_modified
    if last_modified:
        last_modified = last_modified.isoformat()
    counted = vote.progress[0] or 0
    nays_percentage = vote.nays_percentage if counted else None
    yeas_percentage = vote.yeas_percentage if counted else None
    summary = {'answer': vote.answer or None, 'completed': vote.completed,
        'date': vote.date.isoformat(), 'domain': vote.domain,
        'last_modified': last_modified, 'nays_percentage': nays_percentage,
        'progress': {'counted': counted / divider, 'total': (vote.progress[
        1] or 0) / divider}, 'title': vote.title_translations, 'type':
        'vote', 'url': url or request.link(vote), 'yeas_percentage':
        yeas_percentage}
    if 'local' in (vote.meta or {}):
        summary['local'] = {'answer': vote.local_answer or '',
            'nays_percentage': vote.local_nays_percentage,
            'yeas_percentage': vote.local_yeas_percentage}
    return summary
