X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FLeaseFilter.py;h=c7e31bc7d95963ebd09557c6071f1aaf7dfa9170;hb=6c98ac7b4385db298d2a545c4ef11f3f7ebad61d;hp=84f84b7a1e531c1d267330150e0f56350fe6a06e;hpb=000e67f40abedbc826598b580b61a8d16225a4ad;p=plcapi.git diff --git a/PLC/LeaseFilter.py b/PLC/LeaseFilter.py index 84f84b7..c7e31bc 100644 --- a/PLC/LeaseFilter.py +++ b/PLC/LeaseFilter.py @@ -28,11 +28,13 @@ class LeaseFilter(Filter): 'alive': Mixed( Parameter(int, "int_timestamp: leases alive at that time"), Parameter(str, "str_timestamp: leases alive at that time"), - Parameter(tuple, "timeslot: the leases alive during this timeslot")), - 'clip': Mixed( + Parameter(list, "timeslot: the leases alive during this timeslot"), + ), + 'clip': Mixed( Parameter(int, "int_timestamp: leases alive after that time"), Parameter(str, "str_timestamp: leases alive after that time"), - Parameter(tuple, "timeslot: the leases alive during this timeslot")), + Parameter(list, "timeslot: the leases alive during this timeslot"), + ), ########## macros # {'day' : 0} : all leases from today and on # {'day' : 1} : all leases today (localtime at the myplc) @@ -92,7 +94,7 @@ class LeaseFilter(Filter): # the lease is alive at that time if from <= alive <= until alive = LeaseFilter.quote(alive) return LeaseFilter.sql_time_in_range(alive, 't_from', 't_until') - elif isinstance(alive, tuple): + elif isinstance(alive, (tuple, list)): (f, u) = alive f = LeaseFilter.quote(f) u = LeaseFilter.quote(u) @@ -105,7 +107,7 @@ class LeaseFilter(Filter): if isinstance(clip, int) or isinstance(clip, str): start = LeaseFilter.quote(clip) return LeaseFilter.sql_timeslot_after('t_from', 't_until', start) - elif isinstance(clip, tuple): + elif isinstance(clip, (tuple, list)): (f, u) = clip f = LeaseFilter.quote(f) u = LeaseFilter.quote(u)