Finding the last modified timestamp for a group of Models

43 views
Skip to first unread message

Alex Guetsche

unread,
Feb 27, 2024, 8:53:32 AMFeb 27
to Django users
I have an application which contains more than one Model, all descended from an abstract one. All the operational Models have created and modified fields with datetime timestamps. [How] can I get the Django ORM to bring me the last modified timestamp that will be the maximum of all createds and modifieds of all Models? Right now I have to use itertools for a quite convoluted expression over query sets of all the models involved.

It seems quite an obvious use case, and it can be implemented in pure SQL quite easily.

Jason

unread,
Feb 28, 2024, 12:35:07 PMFeb 28
to Django users
Reply all
Reply to author
Forward
0 new messages