from app import app, db
from app.models import User, Post, PostRegister
from datetime import datetime

def count_downvotes(post_id):
    downvotes = PostRegister.query.filter_by(post_id = post_id).sum(downvote)
    return(downvotes)


def count_upvotes(post_id):
    upvotes = PostRegister.query.filter_by(post_id = post_id).sum(upvote)
    return(upvotess)

c5584ec3ea2d06e831162d661f69403eaa3bd881
<mask token>

<mask token>


def count_upvotes(post_id):
    upvotes = PostRegister.query.filter_by(post_id=post_id).sum(upvote)
    return upvotess

<mask token>


def count_downvotes(post_id):
    downvotes = PostRegister.query.filter_by(post_id=post_id).sum(downvote)
    return downvotes


def count_upvotes(post_id):
    upvotes = PostRegister.query.filter_by(post_id=post_id).sum(upvote)
    return upvotess

from app import app, db
from app.models import User, Post, PostRegister
from datetime import datetime


def count_downvotes(post_id):
    downvotes = PostRegister.query.filter_by(post_id=post_id).sum(downvote)
    return downvotes


def count_upvotes(post_id):
    upvotes = PostRegister.query.filter_by(post_id=post_id).sum(upvote)
    return upvotess

from app import app, db
from app.models import User, Post, PostRegister
from datetime import datetime

def count_downvotes(post_id):
    downvotes = PostRegister.query.filter_by(post_id = post_id).sum(downvote)
    return(downvotes)


def count_upvotes(post_id):
    upvotes = PostRegister.query.filter_by(post_id = post_id).sum(upvote)
    return(upvotess)
