def _post_vote(user_bingo_board, field, vote):
if field.board != user_bingo_board:<EOL><INDENT>raise VoteException(<EOL>"<STR_LIT>")<EOL><DEDENT>if vote == "<STR_LIT:0>":<EOL><INDENT>field.vote = <NUM_LIT:0><EOL><DEDENT>elif vote == "<STR_LIT:+>":<EOL><INDENT>field.vote = +<NUM_LIT:1><EOL><DEDENT>elif vote == "<STR_LIT:->":<EOL><INDENT>field.vote = -<NUM_LIT:1><EOL><DEDENT>field.save()<EOL>game = user_bingo_board.game<EOL>Game.objects.filter(id=game.id).update(<EOL>last_used=times.now())<EOL>vote_counts_cachename = '<STR_LIT>'.format(<EOL>field.board.game.id)<EOL>cache.delete(vote_counts_cachename)<EOL>if USE_SSE:<EOL><INDENT>try:<EOL><INDENT>votes = field.num_votes()<EOL>redis.publish("<STR_LIT>", json.dumps({<EOL>'<STR_LIT>': game.site.id,<EOL>'<STR_LIT>': field.word.id,<EOL>'<STR_LIT>': votes,<EOL>}))<EOL>redis.publish("<STR_LIT>", json.dumps({<EOL>'<STR_LIT>': game.site.id,<EOL>'<STR_LIT>': field.id,<EOL>'<STR_LIT>': vote,<EOL>}))<EOL><DEDENT>except RedisConnectionError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
change vote on a field
@param user_bingo_board: the user's bingo board or None
@param field: the BingoField to vote on
@param vote: the vote property from the HTTP POST
@raises: VoteException: if user_bingo_board is None or
the field does not belong to the user's bingo board.
@raises Http404: If the BingoField does not exist.