Yup, it’s pretty horrible. But on the face of it—I know that appearances can deceive—it seems like you could iterate (inefficiently, but it’s not like this is going to be done often) over all the votes with a given voter-ID as in the “slow” case of user_downvote_karma and call Vote.vote with dir=Noneas defined in vote.py for each. Something along these lines, though it probably consists entirely of bugs:
from r2.models import Account, Link, Vote
user = Account._by_name('Eugine\_Nier')
# list() to make sure enumeration is done before we start changing the votes
# (dunno if we actually need to do that)
votee_ids = list([v.c._thing2_id for v in Vote._query(Vote.c._thing1_id == user._id)])
# dir = None to remove a vote
# ip = None because ip isn't needed when not creating a new vote
for votee_id in votee_ids: Vote.vote(user, Link._byID(votee_id), None, None)
Yup, it’s pretty horrible. But on the face of it—I know that appearances can deceive—it seems like you could iterate (inefficiently, but it’s not like this is going to be done often) over all the votes with a given voter-ID as in the “slow” case of user_downvote_karma and call
Vote.vote
withdir=None
as defined in vote.py for each. Something along these lines, though it probably consists entirely of bugs: