def num_solutions(user):
 return Question.objects.filter(solution__creator=user).count()

def num_solutions ( user ) : return Question . objects . filter ( solution__creator = user ) . count ( )
returns the number of solutions a user has .