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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message