FusionIIIT/applications/hostel_management/views.py
def edit_student_room(request):
    """
    This function is used to edit the room number of a student.
    @param:
      request - HttpRequest object containing metadata about the user request.

    @varibles:
      roll_no - stores roll number of the student.
      room_no - stores new room number. 
      batch - stores batch number of the student generated from 'roll_no'
      students - stores students related to 'batch'.
    """
    if request.method == "POST":
        roll_no = request.POST["roll_no"]
        room_no = request.POST["room_no"]
        
        student = Student.objects.get(id=roll_no)
        remove_from_room(student)
        add_to_room(student, new_room=room_no)
        messages.success(request, 'Student room changed successfully.')
        return HttpResponseRedirect(reverse("hostelmanagement:hostel_view"))

    This function is used to edit the room number of a student.
    @param:
      request - HttpRequest object containing metadata about the user request.

    @varibles:
      roll_no - stores roll number of the student.
      room_no - stores new room number. 
      batch - stores batch number of the student generated from 'roll_no'
      students - stores students related to 'batch'.
    
This function is used to edit the room number of a student.
@param:
request - HttpRequest object containing metadata about the user request.

@varibles:
roll_no - stores roll number of the student.
room_no - stores new room number.
batch - stores batch number of the student generated from 'roll_no'
students - stores students related to 'batch'.
This function is used to edit the room number of a student . @param : request - HttpRequest object containing metadata about the user request . @varibles : roll_no - stores roll number of the student . room_no - stores new room number . batch - stores batch number of the student generated from ' roll_no ' students - stores students related to ' batch ' .
def edit_student_room(request):
    if request.method == "POST":
        roll_no = request.POST["roll_no"]
        room_no = request.POST["room_no"]
        student = Student.objects.get(id=roll_no)
        remove_from_room(student)
        add_to_room(student, new_room=room_no)
        messages.success(request, 'Student room changed successfully.')
        return HttpResponseRedirect(reverse("hostelmanagement:hostel_view"))
def edit_student_room ( request ) : if request . method == "POST" : roll_no = request . POST [ "roll_no" ] room_no = request . POST [ "room_no" ] student = Student . objects . get ( id = roll_no ) remove_from_room ( student ) add_to_room ( student , new_room = room_no ) messages . success ( request , 'Student room changed successfully.' ) return HttpResponseRedirect ( reverse ( "hostelmanagement:hostel_view" ) )
This function is used to edit the room number of a student.
This function is used to edit the room number of a student .
"""
    This function is used to edit the room number of a student.
    @param:
      request - HttpRequest object containing metadata about the user request.

    @varibles:
      roll_no - stores roll number of the student.
      room_no - stores new room number. 
      batch - stores batch number of the student generated from 'roll_no'
      students - stores students related to 'batch'.
    """
request