golf/views/view_course.py
def updateCourseTee(request, courseId, courseTeeId):
    """
    Setter function for existing course tee
    """
    if (request.POST['default'] == 'true'):
        ct = CourseTee(id=courseTeeId, default=True, priority=request.POST['priority'], name=request.POST['name'], slope=request.POST['slope'], color=request.POST['color'], course_id=courseId)
        ct.save()
    else:
        ct = CourseTee(id=courseTeeId, default=False, priority=request.POST['priority'], name=request.POST['name'], slope=request.POST['slope'], color=request.POST['color'], course_id=courseId)
        ct.save()
    return JsonResponse({'data' : [{'id':ct.id, 'default':ct.default, 'priority':ct.priority, 'name':ct.name, 'slope':ct.slope, 'color':ct.color, 'course_id':ct.course_id}]})

    Setter function for existing course tee
    
Setter function for existing course tee
Setter function for existing course tee
def updateCourseTee(request, courseId, courseTeeId):
    if (request.POST['default'] == 'true'):
        ct = CourseTee(id=courseTeeId, default=True, priority=request.POST['priority'], name=request.POST['name'], slope=request.POST['slope'], color=request.POST['color'], course_id=courseId)
        ct.save()
    else:
        ct = CourseTee(id=courseTeeId, default=False, priority=request.POST['priority'], name=request.POST['name'], slope=request.POST['slope'], color=request.POST['color'], course_id=courseId)
        ct.save()
    return JsonResponse({'data' : [{'id':ct.id, 'default':ct.default, 'priority':ct.priority, 'name':ct.name, 'slope':ct.slope, 'color':ct.color, 'course_id':ct.course_id}]})
def updateCourseTee ( request , courseId , courseTeeId ) : if ( request . POST [ 'default' ] == 'true' ) : ct = CourseTee ( id = courseTeeId , default = True , priority = request . POST [ 'priority' ] , name = request . POST [ 'name' ] , slope = request . POST [ 'slope' ] , color = request . POST [ 'color' ] , course_id = courseId ) ct . save ( ) else : ct = CourseTee ( id = courseTeeId , default = False , priority = request . POST [ 'priority' ] , name = request . POST [ 'name' ] , slope = request . POST [ 'slope' ] , color = request . POST [ 'color' ] , course_id = courseId ) ct . save ( ) return JsonResponse ( { 'data' : [ { 'id' : ct . id , 'default' : ct . default , 'priority' : ct . priority , 'name' : ct . name , 'slope' : ct . slope , 'color' : ct . color , 'course_id' : ct . course_id } ] } )
Setter function for existing course tee
Setter function for existing course tee
"""
    Setter function for existing course tee
    """
request
courseId
courseTeeId