From 9d967d7ad147c6cfbdc70f7ca4855126b017121e Mon Sep 17 00:00:00 2001 From: vmonakhov Date: Mon, 7 Oct 2024 15:54:03 +0300 Subject: [PATCH] fixed default lexical entries sorting --- lingvodoc/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lingvodoc/models.py b/lingvodoc/models.py index 51f6acf1..8250b13f 100755 --- a/lingvodoc/models.py +++ b/lingvodoc/models.py @@ -2070,11 +2070,13 @@ def graphene_track_multiple( DBSession .query( Entity, - PublishingEntity) + PublishingEntity, + LexicalEntry.created_at) .filter( PublishingEntity.client_id == Entity.client_id, - PublishingEntity.object_id == Entity.object_id)) + PublishingEntity.object_id == Entity.object_id, + LexicalEntry.id == Entity.parent_id)) # Get new entities from entities_before_custom_filtering @@ -2126,10 +2128,8 @@ def graphene_track_multiple( # Default sorting old_entities_result = old_entities_result.order_by( - desc(Entity.parent_client_id), - desc(Entity.parent_object_id), - Entity.client_id, - Entity.object_id) + desc(LexicalEntry.created_at), + Entity.created_at) return ( new_entities_result,