Closed derickfan closed 5 years ago
The issue should be fixed.
In terms of getting both up and downvotes, I can create a new method for that (which is annoying) or I can edit the method to include one more parameter.
It would look like this:
def all_votes_by(username, column_name, data_value, type, operation)
where operation would be either '=' or '<>'
ex.
# get all upvotes
def all_votes_by("chalshaff12", "vote", 1, "post", '=')
# get all downvotes
def all_votes_by("chalshaff12", "vote", -1, "post", '=')
# get all saved
def all_votes_by("chalshaff12", "isSaved", 1, "post", '=')
# get all up and downvotes together
def all_votes_by("chalshaff12", "vote", 0, "post", '<>')
Let me know if you want me to implement that and do it asap
Yea that would be awesome. Thanks
Updated the function, let me know if there are any more issues with it
When I try to get all for the votes for a certain username I get an error saying 'userId' is an unknown column Also is it possible to simultaneously get the upvotes and downvotes rather than having to first get the upvotes then the downvotes?