WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 6 files changed +28
-1
lines changed
Expand file tree Collapse file tree 6 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -561,7 +561,18 @@ def json(self) -> dict:
561561 "value" : 0.0 ,
562562 },
563563 "collection" : "test_collection" ,
564- }
564+ "sort_property" : None ,
565+ },
566+ {
567+ "query" : None ,
568+ "filters" : None ,
569+ "collection" : "test_collection" ,
570+ "sort_property" : {
571+ "property_name" : "test_property" ,
572+ "order" : "ascending" ,
573+ "tie_break" : None ,
574+ },
575+ },
565576 ],
566577 "usage" : {
567578 "model_units" : 1 ,
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ def test_class_exports():
8080 QueryResult ,
8181 QueryResultWithCollection ,
8282 QueryResultWithCollectionNormalized ,
83+ QuerySort ,
8384 QueryWithCollection ,
8485 SearchModeResponseBase ,
8586 Source ,
@@ -142,6 +143,7 @@ def test_class_exports():
142143 QueryAgentResponse ,
143144 QueryResult ,
144145 QueryResultWithCollection ,
146+ QuerySort ,
145147 QueryWithCollection ,
146148 SearchModeResponseBase ,
147149 Source ,
@@ -222,6 +224,7 @@ def test_class_exports():
222224 "FilterAndOr" ,
223225 "QueryResultWithCollectionNormalized" ,
224226 "AggregationResultWithCollectionNormalized" ,
227+ "QuerySort" ,
225228 ]
226229
227230 assert hasattr (
Original file line number Diff line number Diff line change 3737 QueryResult ,
3838 QueryResultWithCollection ,
3939 QueryResultWithCollectionNormalized ,
40+ QuerySort ,
4041 QueryWithCollection ,
4142 SearchModeResponseBase ,
4243 Source ,
110111 "FilterAndOr" ,
111112 "QueryResultWithCollectionNormalized" ,
112113 "AggregationResultWithCollectionNormalized" ,
114+ "QuerySort" ,
113115]
Original file line number Diff line number Diff line change 2828 QueryResult ,
2929 QueryResultWithCollection ,
3030 QueryResultWithCollectionNormalized ,
31+ QuerySort ,
3132 QueryWithCollection ,
3233 SearchModeResponseBase ,
3334 Source ,
8283 "FilterAndOr" ,
8384 "QueryResultWithCollectionNormalized" ,
8485 "AggregationResultWithCollectionNormalized" ,
86+ "QuerySort" ,
8587]
Original file line number Diff line number Diff line change 2929 QueryResult ,
3030 QueryResultWithCollection ,
3131 QueryResultWithCollectionNormalized ,
32+ QuerySort ,
3233 QueryWithCollection ,
3334 SearchModeResponseBase ,
3435 Source ,
8283 "FilterAndOr" ,
8384 "QueryResultWithCollectionNormalized" ,
8485 "AggregationResultWithCollectionNormalized" ,
86+ "QuerySort" ,
8587]
Original file line number Diff line number Diff line change @@ -391,10 +391,17 @@ class FilterAndOr(BaseModel):
391391 filters : list [Union [PropertyFilter , FilterAndOr ]]
392392
393393
394+ class QuerySort (BaseModel ):
395+ property_name : str
396+ order : Literal ["ascending" , "descending" ]
397+ tie_break : Union [QuerySort , None ]
398+
399+
394400class QueryResultWithCollectionNormalized (BaseModel ):
395401 query : Union [str , None ]
396402 filters : Union [PropertyFilter , FilterAndOr , None ]
397403 collection : str
404+ sort_property : Union [QuerySort , None ] = None
398405
399406
400407class AggregationResultWithCollectionNormalized (BaseModel ):
You can’t perform that action at this time.
0 commit comments