progects_id = []
projects = Projects.query.order_by(Projects.id.desc()).paginate(page, POST_PER_PAGE, False)
for i in projects.items:
progects_id.append(i.id)
bd = db.session.query(Bid).filter(Bid.project_id.in_(progects_id)).all()
bids_num = dict()
for l in progects_id:
num = 0
for k in bd:
if k.project_id == l:
num += 1
bids_num[l] = num