Session: How to Get Entity Last Modified

When a document is downloaded from the server it contains various metadata details, including the last modified date of the document.

Last modified date is stored within the session metadata and is available for each entity using the get_last_modified_for method from the advanced session operations.

Syntax

def get_last_modified_for(self, entity: object) -> datetime: ...
Parameter Type Description
entity object Instance of an entity for which the last modified date will be returned.
Return Type Description
datetime Returns the last modified date for an entity. Throws an exception if the entity is not tracked by the session.

Example

employee = session.load("employees/1-A")
last_modified = session.advanced.get_last_modified_for(employee)