# general notes on input parameters
# int_timestamp: number of seconds since the epoch
# str_timestamp: see Timestamp.sql_validate
- # timeslot: a tuple (from, until), each being either int_timestamp or
+ # timeslot: a list [from, until], each being either int_timestamp or
# str_timestamp
local_fields = {
'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)
# 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)
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)