Just go through the dictionary , Then add up to get .
count = 0
user = Question.query.filter(Question.id == question_id).first()
for i in user.comments:
count = count + 1
print(u' Small warm tree ')
comment_nums = count
return render_template('detail.html', question_model=question_model, comment_nums=comment_nums)