[내일배움단 ai트랙 3기] TIL 221020

2022. 10. 20. 23:25스파르타코딩클럽[AI트랙 3기]/TIL

221020

 오늘은 내가 심혈을 기울인 코드를 ..!! 팀원들에게 공개했다. 사실 다른팀원이 거의 다해주신거에 조금 내생각을 붙인건데 하나씩 하나씩 차근차근 해보려고 한다... 하루종일 내 코드 관련해서 구글링하고 회의 한것 외에는 별로 한것이 없다.


ㅁ프로젝트 트러블 슈팅

https://github.com/Taeeun99/sparta_PetDictionary_2L3J_project2/wiki/3.-%ED%8A%B8%EB%9F%AC%EB%B8%94-%EC%8A%88%ED%8C%85

 

GitHub - Taeeun99/sparta_PetDictionary_2L3J_project2: 사물인식 팀 프로젝트

사물인식 팀 프로젝트 . Contribute to Taeeun99/sparta_PetDictionary_2L3J_project2 development by creating an account on GitHub.

github.com

ㅁ프로젝트

yes ==0일때 값 0퍼센트 나오게 해주는 코드

def graph(request):
    if request.method == 'GET':
        yes = ResearchModel.objects.filter(correct=1).count()
        total = ResearchModel.objects.all().count()
        percent = int((yes/total)*100)
        if yes == 0 :
            total == 0
            return render(request, 'accuracy_graph.html',{'data':0})
       
        return render(request, 'accuracy_graph.html',{'data':percent})