Hello I;m having a problem in calling a function that returns a result, from another function
To make it clear, my functiona are:
def calculate_questions_vote(request):
useranswer = Answer.objects.filter (answer_by = request.user)
positive_votes = VoteUpAnswer.objects.filter(answer = useranswer)
negative_votes = VoteDownAnswer.objects.filter(answer = useranswer)
question_vote_rank = sum(positive_votes) - sum(negative_votes.count)
return question_vote_rank
def calculate_replies(request):
the_new = News.objects.filter(created_by = request.user)
reply = Reply.objects.filter(reply_to = the_new)
reply_rank = sum(reply)
return reply_rank
and i want to call them in another function, so that it could return a value. I;m calling the funtion form another funtion like this:
rank = calculate_questions_vote
Let's say i just want for now to display the value returned by the function calculate_questions_vote. Of course, i;m putting the rank variable in the context of the function.
My problem is that my output is:
<function calculate_questions_vote at 0x9420144>
How can i actually make it display the value returned by the funtion, inseted of that string?
Thank you so much!!