@@ -43,8 +43,19 @@ class AllOperators(models.TextChoices):
4343 IS_NOT_EMPTY = "is_not_empty" , _ ("Equal" )
4444 IS_NULL = "is_null" , _ ("Is null" )
4545 IS_NOT_NULL = "is_not_null" , _ ("Is not null" )
46+ BEFORE = "before" , _ ("Before" )
47+ AFTER = "after" , _ ("After" )
4648
4749
50+ DATE_ATTRIBUTES = [
51+ AllOperators .BETWEEN ,
52+ AllOperators .NOT_BETWEEN ,
53+ AllOperators .BEFORE ,
54+ AllOperators .AFTER ,
55+ AllOperators .IS_NULL ,
56+ AllOperators .IS_NOT_NULL ,
57+ ]
58+
4859NUMBER_ATTRIBUTES = [
4960 AllOperators .BETWEEN ,
5061 AllOperators .NOT_BETWEEN ,
@@ -135,6 +146,8 @@ class QueryBuilderService:
135146 AllOperators .IS_NOT_EMPTY .value : "__exact" ,
136147 AllOperators .IS_NULL .value : "__isnull" ,
137148 AllOperators .IS_NOT_NULL .value : "__isnull" ,
149+ AllOperators .BEFORE .value : "__lt" ,
150+ AllOperators .AFTER .value : "__gte" ,
138151 }
139152
140153 ZERO_INPUTS_OPERATORS = {
@@ -312,7 +325,9 @@ def get_all_operators_for_query_builder(cls):
312325 number_of_inputs = 0
313326 else :
314327 number_of_inputs = 1
315- operators .append ({"type" : key , "nb_inputs" : number_of_inputs })
328+ operators .append (
329+ {"type" : key , "nb_inputs" : number_of_inputs , "apply_to" : "string" }
330+ )
316331 return json .dumps (operators ), json .dumps (operators_translations )
317332
318333 @classmethod
0 commit comments