아래 코드를 사용하여 상태를 업데이트하고 있습니다.django에서 모델 객체를 업데이트하는 방법은 무엇입니까?
current_challenge = UserChallengeSummary.objects.filter(user_challenge_id=user_challenge_id).latest('id')
current_challenge.update(status=str(request.data['status']))
나는 오류가 아래에 무엇입니까 :
'UserChallengeSummary' object has no attribute 'update'
의 경우이 오류를 해결 : 내가 솔루션을 발견 레코드를 업데이트 할 수있는 또 다른 방법은
current_challenge.status = str(request.data['status'])
current_challenge.save()
을 있습니까?
내가 아는 한, 당신의 해결책은 장고를 위해 보통이다 – Compadre