장고 자습서를 살펴보고 views.py에서 같은 이름의 함수가 2 개있을 때 어떤 일이 발생하는지 궁금합니다. 예를 들어장고보기 기능을 서로 재정의 할 수 있습니까?
: 나는 코드를 실행할 때
def results(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
return render_to_response('polls/results.html', {'poll': p})
def results(request, poll_id):
return HttpResponse("You're looking at the results of poll %s." % poll_id)
, 아래 함수가 호출 된 하나였다. 이게 어떻게 작동합니까? 내가 착각하고 있지 않다 경우