@@ -667,6 +667,7 @@ class DateQuery(FieldQuery):
667
667
The value of a date field can be matched against a date interval by
668
668
using an ellipsis interval syntax similar to that of NumericQuery.
669
669
"""
670
+
670
671
def __init__ (self , field , pattern , fast = True ):
671
672
super (DateQuery , self ).__init__ (field , pattern , fast )
672
673
start , end = _parse_periods (pattern )
@@ -710,6 +711,7 @@ class DurationQuery(NumericQuery):
710
711
Raises InvalidQueryError when the pattern does not represent an int, float
711
712
or M:SS time interval.
712
713
"""
714
+
713
715
def _convert (self , s ):
714
716
"""Convert a M:SS or numeric string to a float.
715
717
@@ -832,6 +834,7 @@ class FieldSort(Sort):
832
834
"""An abstract sort criterion that orders by a specific field (of
833
835
any kind).
834
836
"""
837
+
835
838
def __init__ (self , field , ascending = True , case_insensitive = True ):
836
839
self .field = field
837
840
self .ascending = ascending
@@ -869,6 +872,7 @@ def __eq__(self, other):
869
872
class FixedFieldSort (FieldSort ):
870
873
"""Sort object to sort on a fixed field.
871
874
"""
875
+
872
876
def order_clause (self ):
873
877
order = "ASC" if self .ascending else "DESC"
874
878
if self .case_insensitive :
@@ -885,12 +889,14 @@ class SlowFieldSort(FieldSort):
885
889
"""A sort criterion by some model field other than a fixed field:
886
890
i.e., a computed or flexible field.
887
891
"""
892
+
888
893
def is_slow (self ):
889
894
return True
890
895
891
896
892
897
class NullSort (Sort ):
893
898
"""No sorting. Leave results unsorted."""
899
+
894
900
def sort (self , items ):
895
901
return items
896
902
0 commit comments