zeeguu/core/model/user_exercise_session.py
def _update_last_action_time(self, db_session, current_time=datetime.now()):
        """
            Updates the last_action_time field and computes the duration of the exercise session

            Parameters:
            db_session = database session
            current_time = when this parameter is sent, instead of using the datetime.now() value for the current time
                        we use the provided value as the system time (only used for filling in historical data)

            returns: The exercise session
        """

        # Update duration
        current_session_length = current_time - self.start_time
        self.duration = current_session_length.total_seconds() * 1000  # Convert to miliseconds

        self.last_action_time = current_time
        db_session.add(self)
        db_session.commit()
        return self

            Updates the last_action_time field and computes the duration of the exercise session

            Parameters:
            db_session = database session
            current_time = when this parameter is sent, instead of using the datetime.now() value for the current time
                        we use the provided value as the system time (only used for filling in historical data)

            returns: The exercise session
        
Updates the last_action_time field and computes the duration of the exercise session
Parameters:
db_session = database session
current_time = when this parameter is sent, instead of using the datetime.now() value for the current time
we use the provided value as the system time (only used for filling in historical data)

The exercise session
Updates the last_action_time field and computes the duration of the exercise session Parameters : db_session = database session current_time = when this parameter is sent instead of using the datetime . now () value for the current time we use the provided value as the system time ( only used for filling in historical data ) The exercise session
def _update_last_action_time(self, db_session, current_time=datetime.now()):
        current_session_length = current_time - self.start_time
        self.duration = current_session_length.total_seconds() * 1000  
        self.last_action_time = current_time
        db_session.add(self)
        db_session.commit()
        return self
def _update_last_action_time ( self , db_session , current_time = datetime . now ( ) ) : current_session_length = current_time - self . start_time self . duration = current_session_length . total_seconds ( ) * 1000 self . last_action_time = current_time db_session . add ( self ) db_session . commit ( ) return self
Updates the last_action_time field and computes the duration of the exercise session
Parameters:
db_session = database session
current_time = when this parameter is sent, instead of using the datetime.now() value for the current time
we use the provided value as the system time (only used for filling in historical data)
Updates the last_action_time field and computes the duration of the exercise session Parameters : db_session = database session current_time = when this parameter is sent instead of using the datetime . now () value for the current time we use the provided value as the system time ( only used for filling in historical data )
"""
            Updates the last_action_time field and computes the duration of the exercise session

            Parameters:
            db_session = database session
            current_time = when this parameter is sent, instead of using the datetime.now() value for the current time
                        we use the provided value as the system time (only used for filling in historical data)

            returns: The exercise session
        """ # Update duration # Convert to miliseconds
self
db_session
current_time